Windows software on linux server

Run Windows application on Linux server

Hi All,
We have a Winforms application with a very minimum UI. We are currently using .Net Framework 4.5. We need to run this application on a Linux machine. We are currently considering migrating the .Net Framework to .Net Core.

Please let us know if there any other better approach to achieve this task or if we can continue with .Net Core.

Any help would be appreciated. Thank you!!

.NET: Microsoft Technologies based on the .NET software framework. Runtime: The period of time during which a program is being executed in a computer.

Sorry for the late response.
Yes, it will be a console application and as per suggestion, we will go ahead with .Net Core. Thank you for your response!!

Hello All,
As we are considering using .Net Core, can anyone suggest which version of .Net Core would be better. Is it better to use .Net Core 3.1 or .Net Core 5.0?? Can anyone please let us know on this. Thank you in advance!!

3 answers

.NET 5 introduce limited support for WinForm, so you may give it a try. You’re strongly advised to review what is not supported and replace them with alternatives before start conversion.

Oh, you’re right. Apologies for the mistake. In that case, to use GUI on Linux you’ll need some cross platform libraries like Xamarin. Note that the GTK# that it based on is still on preview.

It’s there as of late 2018. Although everything (I mean both GTK#, and the GTK# target for Xamarin.Forms) is still in preview, I suppose applications built with simple and general Windows control would have decent chance to work with it. Apparently they «settled» the «QC problem» by explicitly offload support to the community, in order to move forward.

Why don’t install Mono runtime on linux to run your .net winforms application ? I did it to run a winform application on raspberry (Debian)

Agreed. You can just continue to code for .NET Framework 4.X and ignore about .NET Core/.NET 5 for now. I’ve written a few .NET v1.1 application that runs on Linux with Mono 10+ years ago and it needs very little changes to work. (The changes I needed to make are mostly due to filesystem permission difference)

Читайте также:  Linux bluetooth через консоль

If you are running an app in Linux it will be fine .net framework is cross-comp is great for running them.
You just have to download Mono or the .net run time to run apps. (WPF apps use Microsoft’s DX to render the app, so you can’t use that app on Linux or Mac) Developing them however is a wildly hard idea. Winforms is sadly outdated, while MS is trying to update it, the legacy code really bad. You should look into migrating to
Avalonia UI. It’s an Open Source, Cross-platform UI library like WinForms (that is an understatement). If you want to stay on WinForms however Mono supports in runtime and SDK. proof of concept for WinForms running in Linux using Mono Really Avalonia replaces both WPF and WinForms.

Источник

Linux Software Repository for Microsoft Products

Microsoft builds and supports a variety of software products for Linux systems and makes them available via Linux packaging clients (apt, dnf, yum, etc). These Linux software packages are hosted on the «Linux software repository for Microsoft products»: https://packages.microsoft.com. You can file issues or pull requests on the affiliated GitHub repo: Microsoft Linux Package Repositories.

This page offers guidance on how to download and install the «Linux software repository for Microsoft products» (https://packages.microsoft.com) to your Linux system, so you can then install and upgrade Microsoft software that is built for Linux using your distribution’s standard package management tools.

How to install Microsoft software packages using the Linux Repository

The Linux Software Repository can be configured to automatically install the Linux package that applies to your Linux distribution and version. Each Microsoft product may require a slightly different installation process. The package install includes the repository configuration, along with the GPG public key used to validate the signed packages and/or repository metadata.

Optionally, if you prefer manual configuration, the Linux Software Repository configuration files are available at https://packages.microsoft.com/config. The name and location of these files can be located using the following URI naming convention: https://packages.microsoft.com/config///prod.(repo|list)

Examples of available Microsoft products in the Linux Repository

The following Microsoft products are a few examples that offer Linux versions supported for install using the Linux Repository (package.microsoft.com). See the associated documentation link for more specific installation steps.

Packages in the Linux Software Repository are subject to the license terms located in each package. Please read the license terms prior to using the package. Your installation and use of the package constitutes your acceptance of these terms. If you do not agree with the license terms, do not use the package.

Читайте также:  Как установить хромиум линукс

How to use the GPG Repository Signing Key

Linux Software Repository for Microsoft Products uses the GPG (GNU Privacy Guard) enabling users to verify the authenticity of files and to check the signatures of downloaded packages.

  • Microsoft’s GPG public key may be downloaded here: https://packages.microsoft.com/keys/microsoft.asc
  • Public Key ID: Microsoft (Release signing) gpgsecurity@microsoft.com
  • Public Key Fingerprint: BC52 8686 B50D 79E3 39D3 721C EB3E 94AD BE12 29CF

Command examples for using the Linux repository service

  • Install a repository configuration: curl -sSL https://packages.microsoft.com/config///prod.list | sudo tee /etc/apt/sources.list.d/microsoft-prod.list (replacing and with the name of the supported Linux distribution and version you wish to use). If you’re unsure what distribution and version you are currently running, you can try entering lsb_release -a (for any distro that includes the “lsb-release» package) or cat /etc/os-release (for any distro that uses systemd).
  • Download the Microsoft repository GPG public key: curl -sSL https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc
  • Register the Microsoft repository GPG public key: sudo dpkg -i packages-microsoft-prod.deb
  • Delete the the Microsoft repository GPG public keys file after registering: rm packages-microsoft-prod.deb
  • Update package index files: sudo update (replacing with the appropriate command for the package manager used with your Linux distribution).
  • To install the Microsoft product package you’re after using this Linux repository (packages.microsoft.com): sudo install (replacing with the appropriate command for the package manager used with your Linux distribution and with the name of the Microsoft software that you want to install).

See packages.microsoft.com find the list of supported Linux distributions and versions.

How to file an issue, request a feature, or report a security vulnerability

We want to ensure that our Linux customers are well-supported. The following communication channels are available to users of the PMC service:

  • Report an issue: Help us improve the PMC service by reporting any issues you are experiencing.
  • Request a feature: Request a new feature or enhancement to the PMC service.
  • Report a security vulnerability: Help us to identify any potential security vulnerabilities by reviewing our security policy and reporting any issues.

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

ZILosoft/Windows-on-linux-server

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Читайте также:  Java home linux command

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

windows приложение в linux

Запускаем программы Windows на удаленном Linux сервере

Была у меня как то проблемка, везде используется linux но вот одна программа работала только на Windows а именно Litemanager NoIP сервер, держать ради нее отдельную Windows машину не хотелось, да и с у четом того что от программы нужно блыо только чтобы она «проксировала» было решено перенести это на маленькую ubuntu машину где нибудь в облаке

в данном примере я использую Ubuntu 16.04

sudo dpkg —add-architecture i386

wget -nc https://dl.winehq.org/wine-builds/winehq.key

sudo apt-key add winehq.key

Устанавливаем fluxbox и vnc4server:

sudo apt-get install fluxbox vnc4server

добавляем пользователя vnc_server

переключаемся напользователя vnc_server

vncserver -geometry 800x600 -depth 24 vncserver -kill :1 

Настраиваем VNC для инеграции с fluxbox

echo «fluxbox &» >> ~/.vnc/xstartup

sudo nano /etc/systemd/system/vnc_server.service

[Unit] Description=VNC Server After=network.target [Service] Type=oneshot ExecStart=/bin/sh -c "/usr/bin/vnc_server.sh start" &>/dev/null & ExecStop=/bin/sh -c "/usr/bin/vnc_server.sh stop" RemainAfterExit=yes [Install] WantedBy=multi-user.target 

Сохраняем, перезапускаем systemctl

sudo systemctl daemon-reload

Создаем скрипт запуска vncserver имени пользователя vnc_server

sudo nano /usr/bin/vnc_server.sh

#!/bin/sh export PATH="/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin" #service=vnc_server.service start() < # start daemon echo -n "Starting VNC: " su -c "vncserver :1 -geometry 800x600 -depth 24" vnc_server RETVAL=$? return $RETVAL >stop() < # stop daemon echo -n "Stopping VNC: " su -c "vncserver -kill :1 >/dev/null 2>&1" vnc_server RETVAL=$? return $RETVAL > case "$1" in start) start RETVAL=$? ;; stop) stop RETVAL=$? ;; restart) stop sleep 1 start RETVAL=$? ;; condrestart) stop sleep 1 start ;; status) status $service RETVAL=0 ;; *) echo "Usage: $service " RETVAL=1 ;; esac exit $RETVAL 

Включаем серис при запуске:

sudo systemctl enable vnc_server

sudo chmod 775 /usr/bin/vnc_server.sh

Копируем программу на сервер

scp -r ~/lm пользовательssh@адрессервера:~/lm

Переносим в папку vnc_server

sudo mkdir /home/vnc_server/lm & sudo mv ~/lm/* /home/vnc_server/lm sudo chown vnc_server /home/vnc_server/lm/* 

Используя люой vnc клиент подключаемся к серверу правой кнопкой мыши запускаем Applications>Terminal Emulators>Xterm и в водим

Автозапуск программы при старте системы:

sudo nano /home/vnc_server/.fluxbox/startup

и перед exec fluxbox добавляем

хочу так же добавить что LMNoIpServer была выбрана в качестве примера

Источник

Оцените статью
Adblock
detector