2020-11-07 16:25:05 -05:00
2020-11-07 16:25:05 -05:00
2020-11-07 16:25:05 -05:00
2020-11-07 16:25:05 -05:00
2020-11-07 16:25:05 -05:00
2020-11-07 16:25:05 -05:00
2020-11-07 16:25:05 -05:00
2020-11-07 16:25:05 -05:00

WinApps for Linux

Run Windows apps such as Microsoft Office in Linux (Ubuntu) and GNOME as if they were a part of the native OS, including Nautilus integration for right clicking on files of specific mime types to open them.

![Demo](demo/demo.gif | width=600)

How it works and why WinApps exists

Back in April, Hayden Barnes tweeted what appeared to be native Windows apps in a container or VM inside Ubuntu. However, no details have emerged on how this was accomplished, though it is likely a similar method to this but with an insider build Windows Container.

Rather than wait around for this, WinApps was created as an easy, one command way to include apps running inside a VM (or on any RDP server) directly into GNOME as if they were native applications. WinApps works by:

  • Running a Windows RDP server in a background VM container
  • Checking the RDP server for installed applications such as Microsoft Office
  • If those programs are installed, it creates shortcuts leveraging FreeRDP for both the CLI and the GNOME tray

Installation

Creating your WinApps configuration file

You will need to create a ~/.winapps configuration file with the following information in it:

RDP_USER="MyWindowsUser"
RDP_PASS="MyWindowsPassword"
#RDP_IP="192.168.123.111"

If you are using Option 2 below with a pre-existing non-KVM RDP server, you can use the RDP_IP to specify it's location. If you are running a VM in KVM with NAT enabled, leave RDP_IP commented out and WinApps will auto-detect the right local IP.

Option 1 - Running KVM

You can refer to the KVM documentation for specifics, but the first thing you need to do is set up a Virtual Machine running Windows 10 Professional (or any version that supports RDP). Fist, install KVM:

git clone https://github.com/Fmstrat/winapps.git
cd winapps
sudo apt-get install -y virt-manager

Now set up KVM to run as your user instead of root and allow it through AppArmor (for Ubuntu 20.04 and above):

sudo sed -i "s/#user = "root"/user = "$(id -un)"/g" /etc/libvirt/qemu.conf
sudo sed -i "s/#group = "root"/group = "$(id -gn)"/g" /etc/libvirt/qemu.conf
sudo usermod -a -G kvm $(id -un)
sudo usermod -a -G libvirt $(id -un)
sudo systemctl restart libvirtd
sudo ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/

sleep 5

sudo virsh net-autostart default
sudo virsh net-start default

You will likely need to reboot to ensure your current shell is added to the group.

Next, define a VM called RDPWindows from the sample XML file with:

virsh define kvm/RDPWindows.xml
virsh autostart RDPWindows

You will now want to change any settings on the VM and install Windows. You can access the VM with:

virt-manager

After the install process, you will want to:

  • Go to the Start Menu
    • Type "About"
    • Open "About"
    • Change the PC name to "RDPWindows" (This will allow WinApps to detect the local IP)
  • Go to Control Panel
    • Under "System," allow remote connections for RDP
  • Merge kvm/RDPApps.reg into the registry to enable RDP Applications

And the final step is to run the installer:

$ ./install.sh
[sudo] password for fmstrat: 
Installing...
  Checking for installed apps in RDP machine...
  Installing Excel...
  Installing PowerPoint...
  Installing Word...
  Installing Windows...
Installation complete.

Option 2 - I already have an RDP server or VM

If you already have an RDP server or VM, using WinApps is very straight forward. Simply create your ~/.winapps configuration file, and run:

$ git clone https://github.com/Fmstrat/winapps.git
$ cd winapps
$ ./install.sh
[sudo] password for fmstrat: 
Installing...
  Checking for installed apps in RDP machine...
  Installing Excel...
  Installing PowerPoint...
  Installing Word...
  Installing Windows...
Installation complete.

You will need to make sure RDP Applications are enabled, which can be set by merging in kvm/RDPApps.reg into the registry.

Adding applications

Adding applications to the installer is easy. Simply copy one of the application configurations in the apps folder, and:

  • Edit the variables for the application
  • Replace the icon.svg with an SVG for the application
  • Re-run the installer
  • Submit a Pull Request to add it to WinApps officially
Description
Run Windows apps such as Microsoft Office/Adobe in Linux (Ubuntu/Fedora) and GNOME/KDE as if they were a part of the native OS, including Nautilus integration. Hard fork of https://github.com/Fmstrat/winapps/
Readme 20 MiB
Languages
Shell 86.2%
PowerShell 10.1%
Nix 3.2%
Batchfile 0.5%