Initial commit.
106
README.md
@ -1,2 +1,104 @@
|
||||
# winapps
|
||||
Run Windows apps such as Microsoft Office in Linux (Ubuntu) and GNOME as if they were a part of the native OS.
|
||||
# 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.
|
||||
|
||||

|
||||
|
||||
## How it works and why WinApps exists
|
||||
Back in April, Hayden Barnes [tweeted](https://twitter.com/unixterminal/status/1255919797692440578?lang=en) 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:
|
||||
``` bash
|
||||
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](https://www.linux-kvm.org) 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:
|
||||
``` bash
|
||||
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):
|
||||
``` bash
|
||||
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:
|
||||
``` bash
|
||||
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:
|
||||
``` bash
|
||||
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:
|
||||
``` bash
|
||||
$ ./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:
|
||||
``` bash
|
||||
$ 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
|
1
apps/excel/icon.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1{fill:#21a366;}.cls-2{fill:none;}.cls-3{fill:#107c41;}.cls-4{fill:#33c481;}.cls-5{fill:#185c37;}.cls-6{opacity:0.5;}.cls-7{fill:#fff;}</style></defs><title>Excel_24x</title><g id="Excel"><g id="_24" data-name="24"><path class="cls-1" d="M16,1H7A1,1,0,0,0,6,2V7l10,5,4,1.5L24,12V7Z"/><rect class="cls-2" width="24" height="24"/><rect class="cls-3" x="6" y="7.02" width="10" height="4.98"/><path class="cls-4" d="M24,2V7H16V1h7A1,1,0,0,1,24,2Z"/><path class="cls-5" d="M16,12H6V22a1,1,0,0,0,1,1H23a1,1,0,0,0,1-1V17Z"/><path class="cls-6" d="M13.83,6H6V20h7.6A1.5,1.5,0,0,0,15,18.65V7.17A1.18,1.18,0,0,0,13.83,6Z"/><rect id="Back_Plate" data-name="Back Plate" class="cls-3" y="5" width="14" height="14" rx="1.17"/><path class="cls-7" d="M3.43,16,6,12,3.64,8H5.55l1.3,2.55a4.63,4.63,0,0,1,.24.54h0a5.77,5.77,0,0,1,.27-.56L8.76,8h1.75L8.08,12l2.49,4H8.71l-1.5-2.8A2.14,2.14,0,0,1,7,12.83H7a1.54,1.54,0,0,1-.17.36L5.3,16Z"/><rect class="cls-3" x="16" y="12" width="8" height="5"/></g></g></svg>
|
After Width: | Height: | Size: 1.0 KiB |
17
apps/excel/info
Normal file
@ -0,0 +1,17 @@
|
||||
# GNOME shortcut name
|
||||
NAME="Excel"
|
||||
|
||||
# Used for descriptions and window class
|
||||
FULL_NAME="Microsoft Excel"
|
||||
|
||||
# The executable inside windows
|
||||
WIN_EXECUTABLE="C:\Program Files\Microsoft Office\Office16\EXCEL.EXE"
|
||||
|
||||
# The icon in the icon folder
|
||||
ICON="excel.svg"
|
||||
|
||||
# GNOME categories
|
||||
CATEGORIES="Office"
|
||||
|
||||
# GNOME mimetypes
|
||||
MIME_TYPES="application/vnd.ms-excel;application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;application/vnd.openxmlformats-officedocument.spreadsheetml.template;application/vnd.ms-excel.sheet.macroEnabled.12;application/vnd.ms-excel.template.macroEnabled.12;application/vnd.ms-excel.addin.macroEnabled.12;application/vnd.ms-excel.sheet.binary.macroEnabled.12;"
|
1
apps/powerpoint/icon.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1{fill:none;}.cls-2{fill:#ed6c47;}.cls-3{fill:#ff8f6b;}.cls-4{fill:#d35230;}.cls-5{opacity:0.5;}.cls-6{opacity:0.1;}.cls-7{fill:#c43e1c;}.cls-8{fill:#fff;}</style></defs><title>Powerpoint_24x</title><g id="Powerpoint"><rect class="cls-1" width="24" height="24"/><path class="cls-2" d="M13,1A11,11,0,0,0,2,12l14.84,3.84Z"/><path class="cls-3" d="M13,1A11,11,0,0,1,24,12L18.5,15,13,12Z"/><path class="cls-4" d="M2,12a11,11,0,0,0,22,0Z"/><path class="cls-5" d="M15,18.65V7.17A1.18,1.18,0,0,0,13.83,6H3.8A10.91,10.91,0,0,0,5.49,20H13.6A1.5,1.5,0,0,0,15,18.65Z"/><path class="cls-6" d="M15,18.65V7.17A1.18,1.18,0,0,0,13.83,6H3.8A10.91,10.91,0,0,0,5.49,20H13.6A1.5,1.5,0,0,0,15,18.65Z"/><rect id="Back_Plate" data-name="Back Plate" class="cls-7" y="5" width="14" height="14" rx="1.17"/><path class="cls-8" d="M7.4,8a3.32,3.32,0,0,1,2.2.64,2.32,2.32,0,0,1,.76,1.86A3.42,3.42,0,0,1,10,12.11a2.54,2.54,0,0,1-1.07,1,3.7,3.7,0,0,1-1.61.34H5.78V16H4.22V8ZM5.78,12H7.12a1.78,1.78,0,0,0,1.19-.35,1.46,1.46,0,0,0,.4-1.1c0-.88-.51-1.32-1.54-1.32H5.78Z"/></g></svg>
|
After Width: | Height: | Size: 1.1 KiB |
17
apps/powerpoint/info
Normal file
@ -0,0 +1,17 @@
|
||||
# GNOME shortcut name
|
||||
NAME="PowerPoint"
|
||||
|
||||
# Used for descriptions and window class
|
||||
FULL_NAME="Microsoft PowerPoint"
|
||||
|
||||
# The executable inside windows
|
||||
WIN_EXECUTABLE="C:\Program Files\Microsoft Office\Office16\POWERPNT.EXE"
|
||||
|
||||
# The icon in the icon folder
|
||||
ICON="powerpoint.svg"
|
||||
|
||||
# GNOME categories
|
||||
CATEGORIES="Office"
|
||||
|
||||
# GNOME mimetypes
|
||||
MIME_TYPES="application/vnd.ms-powerpoint;application/vnd.openxmlformats-officedocument.presentationml.presentation;application/vnd.openxmlformats-officedocument.presentationml.template;application/vnd.openxmlformats-officedocument.presentationml.slideshow;application/vnd.ms-powerpoint.addin.macroEnabled.12;application/vnd.ms-powerpoint.presentation.macroEnabled.12;application/vnd.ms-powerpoint.template.macroEnabled.12;application/vnd.ms-powerpoint.slideshow.macroEnabled.12;"
|
1
apps/word/icon.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1{fill:none;}.cls-2{fill:#41a5ee;}.cls-3{fill:#2b7cd3;}.cls-4{fill:#185abd;}.cls-5{fill:#103f91;}.cls-6{opacity:0.5;}.cls-7{fill:#fff;}</style></defs><title>Word_24x</title><g id="Word"><g id="_24" data-name="24"><rect class="cls-1" width="24" height="24"/><path class="cls-2" d="M24,7V2a1,1,0,0,0-1-1H7A1,1,0,0,0,6,2V7l9,2Z"/><polygon class="cls-3" points="24 7 6 7 6 12 15.5 14 24 12 24 7"/><polygon class="cls-4" points="24 12 6 12 6 17 15 18.5 24 17 24 12"/><path class="cls-5" d="M6,17H24a0,0,0,0,1,0,0v5a1,1,0,0,1-1,1H7a1,1,0,0,1-1-1V17a0,0,0,0,1,0,0Z"/><path class="cls-6" d="M13.83,6H6V20h7.6A1.5,1.5,0,0,0,15,18.65V7.17A1.18,1.18,0,0,0,13.83,6Z"/><rect id="Back_Plate" data-name="Back Plate" class="cls-4" y="5" width="14" height="14" rx="1.17"/><path id="Letter" class="cls-7" d="M10.16,16H8.72L7,10.48,5.28,16H3.84L2.24,8H3.68L4.8,13.6,6.48,8.16h1.2l1.6,5.44L10.4,8h1.36Z"/></g></g></svg>
|
After Width: | Height: | Size: 977 B |
17
apps/word/info
Normal file
@ -0,0 +1,17 @@
|
||||
# GNOME shortcut name
|
||||
NAME="Word"
|
||||
|
||||
# Used for descriptions and window class
|
||||
FULL_NAME="Microsoft Word"
|
||||
|
||||
# The executable inside windows
|
||||
WIN_EXECUTABLE="C:\Program Files\Microsoft Office\Office16\WINWORD.EXE"
|
||||
|
||||
# The icon in the icon folder
|
||||
ICON="word.svg"
|
||||
|
||||
# GNOME categories
|
||||
CATEGORIES="Office"
|
||||
|
||||
# GNOME mimetypes
|
||||
MIME_TYPES="application/msword;application/vnd.openxmlformats-officedocument.wordprocessingml.document;application/vnd.openxmlformats-officedocument.wordprocessingml.template;application/vnd.ms-word.document.macroEnabled.12;application/vnd.ms-word.template.macroEnabled.12;"
|
72
bin/winapps
Executable file
@ -0,0 +1,72 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Install windows in KVM
|
||||
# Use the user "User"
|
||||
# Name the machine "RDPWindows" in "About"
|
||||
# Allow remote desktop
|
||||
#
|
||||
# virsh autostart RDPWindows
|
||||
# For 20.04:
|
||||
# sudo ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/
|
||||
|
||||
# Windows Registry Editor Version 5.00
|
||||
|
||||
# [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList]
|
||||
# "fDisabledAllowList"=dword:00000001
|
||||
|
||||
# [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]
|
||||
# "LimitBlankPasswordUse"=dword:00000000
|
||||
|
||||
DIR="$(dirname "$(readlink -f "$0")")"
|
||||
|
||||
if [ -f /tmp/winapps ]; then
|
||||
LAST_RAN=$(stat -t -c %Y /tmp/winapps)
|
||||
touch /tmp/winapps
|
||||
THIS_RUN=$(stat -t -c %Y /tmp/winapps)
|
||||
if (( $THIS_RUN - $LAST_RAN < 2 )); then
|
||||
exit
|
||||
fi
|
||||
else
|
||||
touch /tmp/winapps
|
||||
fi
|
||||
|
||||
if [ -z "$(which xfreerdp)" ]; then
|
||||
echo "You need xfreerdp!"
|
||||
echo " sudo apt-get install -y freerdp2-x11"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ ! -f "${HOME}/.winapps" ]; then
|
||||
echo "You need to create a ~/.winapps configuration. Exiting..."
|
||||
exit
|
||||
fi
|
||||
|
||||
. "${HOME}/.winapps"
|
||||
|
||||
if [ -z "${RDP_IP}" ]; then
|
||||
if [ -z "$(groups |grep libvirt)" ]; then
|
||||
echo "You are not a member of the libvirt group. Run the below then reboot."
|
||||
echo ' sudo usermod -a -G libvirt $(whoami)'
|
||||
echo ' sudo usermod -a -G kvm $(whoami)'
|
||||
exit
|
||||
fi
|
||||
if [ -z "$(virsh list |grep RDPWindows)" ]; then
|
||||
echo "RDPWindows is not running, run:"
|
||||
echo " virsh start RDPWindows"
|
||||
exit
|
||||
fi
|
||||
RDP_IP=$(virsh net-dhcp-leases default |grep RDPWindows |awk '{print $5}')
|
||||
RDP_IP=${RDP_IP%%\/*}
|
||||
fi
|
||||
|
||||
if [ "${1}" = "windows" ]; then
|
||||
xfreerdp /u:"${RDP_USER}" /p:"${RDP_PASS}" /v:${RDP_IP} /dynamic-resolution +auto-reconnect +home-drive /wm-class:"Microsoft Windows" 1> /dev/null 2>&1 &
|
||||
elif [ "${1}" != "install" ]; then
|
||||
. "${DIR}/../apps/${1}/info"
|
||||
if [ -n "${2}" ]; then
|
||||
FILE=$(echo "${2}" | sed 's|'"${HOME}"'|\\\\tsclient\\home|;s|/|\\|g;s|\\|\\\\|g')
|
||||
xfreerdp /u:"${RDP_USER}" /p:"${RDP_PASS}" /v:${RDP_IP} +auto-reconnect +home-drive -wallpaper /span /wm-class:"${FULL_NAME}" /app:"${WIN_EXECUTABLE}" /app-icon:"${DIR}/../apps/${1}/icon.svg" /app-cmd:"\"${FILE}\"" 1> /dev/null 2>&1 &
|
||||
else
|
||||
xfreerdp /u:"${RDP_USER}" /p:"${RDP_PASS}" /v:${RDP_IP} +auto-reconnect +home-drive -wallpaper /span /wm-class:"${FULL_NAME}" /app:"${WIN_EXECUTABLE}" /app-icon:"${DIR}/../apps/${1}/icon.svg" 1> /dev/null 2>&1 &
|
||||
fi
|
||||
fi
|
BIN
demo/demo.gif
Normal file
After Width: | Height: | Size: 3.4 MiB |
1
icons/onenote.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1{fill:none;}.cls-2{fill:#ca64ea;}.cls-3{opacity:0.75;}.cls-4{fill:#7719aa;}.cls-5{fill:#fff;}.cls-6{fill:#ae4bd5;}.cls-7{fill:#9332bf;}</style></defs><title>OneNote_24x</title><g id="OneNote"><g id="_24" data-name="24"><rect class="cls-1" width="24" height="24"/><path class="cls-2" d="M23,1H7A1,1,0,0,0,6,2V22a1,1,0,0,0,1,1H20.23A3.77,3.77,0,0,0,24,19.23V2A1,1,0,0,0,23,1Z"/><path class="cls-3" d="M13.83,6H6V20h7.6A1.5,1.5,0,0,0,15,18.65V7.17A1.18,1.18,0,0,0,13.83,6Z"/><rect id="Back_Plate" data-name="Back Plate" class="cls-4" y="5" width="14" height="14" rx="1.17"/><path class="cls-5" d="M3.8,8H5.5l2.94,5.16a5.34,5.34,0,0,1,.33.77h0a6.57,6.57,0,0,1-.05-1.06V8H10.2v8H8.61L5.55,10.68a5.11,5.11,0,0,1-.31-.55h0a10.22,10.22,0,0,1,0,1.16V16H3.8Z"/><rect class="cls-6" x="18" y="5" width="6" height="6"/><rect class="cls-7" x="18" y="11" width="6" height="6"/><path class="cls-4" d="M18,17v6h5a1,1,0,0,0,1-1V17Z"/></g></g></svg>
|
After Width: | Height: | Size: 1009 B |
1
icons/outlook.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><defs><style>.cls-1{fill:none;}.cls-2{fill:#0364b8;}.cls-3,.cls-8{fill:#0a2767;}.cls-4{fill:#28a8ea;}.cls-5{fill:#35b8f1;}.cls-6{fill:#50d9ff;}.cls-7{fill:#0078d4;}.cls-11,.cls-8{opacity:0.5;}.cls-9{fill:#1490df;}.cls-10{opacity:0.1;}.cls-12{fill:#fff;}</style></defs><title>Outlook_24x</title><g id="Outlook"><g id="_24" data-name="24"><rect class="cls-1" width="24" height="24"/><path class="cls-2" d="M21,1H8A1,1,0,0,0,7,2V3l8,2.45L22,3V2A1,1,0,0,0,21,1Z"/><path class="cls-3" d="M24,11.92a.54.54,0,0,0-.26-.46h0L15.13,6.56A.41.41,0,0,0,15,6.49a1.23,1.23,0,0,0-1.06,0h0a.41.41,0,0,0-.11.07L5.28,11.43h0a.53.53,0,0,0,0,.91h0l8.59,4.93.11.06h0a1.15,1.15,0,0,0,1.06,0l.11-.06,8.59-4.9h0A.53.53,0,0,0,24,11.92Z"/><polygon class="cls-4" points="15 3 7 3 7 10 15 18 22 18 22 10 15 3"/><polyline class="cls-5" points="23.56 22.82 5.29 12.37 5.28 12.37"/><rect class="cls-6" x="15" y="3" width="7" height="7"/><rect class="cls-7" x="7" y="10" width="8" height="10"/><path class="cls-8" d="M14.5,19.5,5.29,12.35l.49-.86,8.61,4.94a.34.34,0,0,0,.24,0l8.5-4.85.5.87Z"/><polygon class="cls-9" points="13.85 17.27 13.88 17.28 13.85 17.27 13.85 17.27"/><path class="cls-9" d="M23.74,12.36h0L15.2,17.25l-.17.08a1.23,1.23,0,0,1-.54.13,1.15,1.15,0,0,1-.53-.13l2.77,3.85,6.83,1.63A1,1,0,0,0,24,22V11.9A.56.56,0,0,1,23.74,12.36Z"/><path class="cls-10" d="M24,22v-.07l-8.5-4.85-.3.18-.17.09a1.33,1.33,0,0,1-.53.12h-.07a1.24,1.24,0,0,1-.43-.11v0L18,21l5.56,1.81A1,1,0,0,0,24,22Z"/><path class="cls-4" d="M13.85,17.27,7,13.19H7l-1.74-.83h0A.53.53,0,0,1,5,11.9V22a1,1,0,0,0,1,1H22.8a1.16,1.16,0,0,0,.76-.19Z"/><path class="cls-11" d="M13.6,20A1.5,1.5,0,0,0,15,18.65V7.17A1.18,1.18,0,0,0,13.83,6H7v4.47l-1.74,1h0a.47.47,0,0,0-.26.42s0,0,0,0H5V20Z"/><rect id="Back_Plate" data-name="Back Plate" class="cls-7" y="5" width="14" height="14" rx="1.17"/><path class="cls-12" d="M3.46,9.83A3.59,3.59,0,0,1,4.87,8.28,4.27,4.27,0,0,1,7.1,7.72a4,4,0,0,1,2.07.53,3.62,3.62,0,0,1,1.37,1.48A5,5,0,0,1,11,11.92a5,5,0,0,1-.49,2.28,3.6,3.6,0,0,1-1.41,1.53A4,4,0,0,1,7,16.28a4,4,0,0,1-2.11-.54,3.55,3.55,0,0,1-1.39-1.48A4.73,4.73,0,0,1,3,12.1,5.15,5.15,0,0,1,3.46,9.83ZM5,13.48a2.31,2.31,0,0,0,.79,1A2.07,2.07,0,0,0,7,14.87a2.16,2.16,0,0,0,1.31-.38,2.22,2.22,0,0,0,.77-1A3.78,3.78,0,0,0,9.32,12a4.45,4.45,0,0,0-.23-1.45,2.32,2.32,0,0,0-.75-1.06A2,2,0,0,0,7,9.13a2.16,2.16,0,0,0-1.27.37,2.36,2.36,0,0,0-.8,1A3.69,3.69,0,0,0,4.69,12,3.81,3.81,0,0,0,5,13.48Z"/></g></g></svg>
|
After Width: | Height: | Size: 2.4 KiB |
49
icons/windows.svg
Normal file
@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve">
|
||||
<g>
|
||||
<path style="fill:#73A1FB;" d="M235.015,43.268v195.943c0,2.318,1.878,4.197,4.197,4.197h268.525c2.318,0,4.197-1.878,4.197-4.197
|
||||
V4.197c0-1.219-0.529-2.377-1.45-3.174c-0.92-0.797-2.14-1.153-3.351-0.979L238.607,39.115
|
||||
C236.544,39.416,235.015,41.185,235.015,43.268z"/>
|
||||
<path style="fill:#73A1FB;" d="M205.641,469.945c1.009,0,1.991-0.363,2.76-1.034c0.913-0.797,1.437-1.951,1.437-3.163V272.787
|
||||
c0-2.318-1.878-4.197-4.197-4.197H4.351c-1.113,0-2.181,0.443-2.968,1.229c-0.787,0.787-1.229,1.855-1.229,2.968l0.01,165.376
|
||||
c0,2.097,1.549,3.874,3.626,4.16l201.28,27.588C205.26,469.932,205.451,469.945,205.641,469.945z"/>
|
||||
<path style="fill:#73A1FB;" d="M4.38,243.408h201.261c2.318,0,4.197-1.878,4.197-4.197V48.146c0-1.212-0.524-2.364-1.435-3.161
|
||||
c-0.912-0.797-2.117-1.163-3.325-0.997L3.633,71.344C1.549,71.628-0.002,73.406,0,75.507l0.183,163.707
|
||||
C0.186,241.531,2.065,243.408,4.38,243.408z"/>
|
||||
<path style="fill:#73A1FB;" d="M507.736,512c1.006,0,1.984-0.361,2.753-1.029c0.917-0.797,1.444-1.951,1.444-3.168L512,272.787
|
||||
c0-1.111-0.441-2.181-1.229-2.968c-0.787-0.787-1.855-1.229-2.968-1.229H239.211c-2.318,0-4.197,1.878-4.197,4.197v197.239
|
||||
c0,2.092,1.541,3.864,3.611,4.156L507.15,511.96C507.347,511.987,507.541,512,507.736,512z"/>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
<g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.7 KiB |
76
install.sh
Executable file
@ -0,0 +1,76 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
sudo ls > /dev/null
|
||||
|
||||
echo "Installing..."
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
. "${DIR}/bin/winapps" install
|
||||
|
||||
# Check for installed apps
|
||||
echo -n " Checking for installed apps in RDP machine..."
|
||||
rm -f ${HOME}/.winapps.installed.bat
|
||||
rm -f ${HOME}/.winapps.installed
|
||||
for F in $(ls "${DIR}/apps"); do
|
||||
. "${DIR}/apps/${F}/info"
|
||||
echo "IF EXIST \"${WIN_EXECUTABLE}\" ECHO ${F} >> \\\\tsclient\\home\\.winapps.installed" >> ${HOME}/.winapps.installed.bat
|
||||
done;
|
||||
touch ${HOME}/.winapps.installed
|
||||
LAST_RAN=$(stat -t -c %Y ${HOME}/.winapps.installed)
|
||||
sleep 6
|
||||
xfreerdp /u:"${RDP_USER}" /p:"${RDP_PASS}" /v:${RDP_IP} +auto-reconnect +home-drive -wallpaper /span /wm-class:"RDPInstaller" /app:"C:\Windows\System32\cmd.exe" /app-icon:"${DIR}/../icons/windows.svg" /app-cmd:"/C \\\\tsclient\\home\\.winapps.installed.bat" 1> /dev/null 2>&1 &
|
||||
sleep 6
|
||||
THIS_RUN=$(stat -t -c %Y ${HOME}/.winapps.installed)
|
||||
while (( $THIS_RUN - $LAST_RAN < 5 )); do
|
||||
sleep 5
|
||||
THIS_RUN=$(stat -t -c %Y ${HOME}/.winapps.installed)
|
||||
done
|
||||
echo ""
|
||||
|
||||
# Install apps
|
||||
for F in $(cat "${HOME}/.winapps.installed" |sed 's/\r/\n/g'); do
|
||||
. "${DIR}/apps/${F}/info"
|
||||
echo -n " Installing ${NAME}..."
|
||||
sudo rm -f "/usr/share/applications/${F}.desktop"
|
||||
echo "[Desktop Entry]
|
||||
Name=${NAME}
|
||||
Exec=${DIR}/bin/winapps ${F} %F
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Icon=${DIR}/apps/${F}/icon.svg
|
||||
StartupWMClass=${FULL_NAME}
|
||||
Comment=${FULL_NAME}
|
||||
Categories=${CATEGORIES}
|
||||
MimeType=${MIME_TYPES}
|
||||
" |sudo tee "/usr/share/applications/${F}.desktop" > /dev/null
|
||||
sudo rm -f "/usr/local/bin/${F}"
|
||||
echo "#!/usr/bin/env bash
|
||||
${DIR}/bin/winapps ${F} $@
|
||||
" |sudo tee "/usr/local/bin/${F}" > /dev/null
|
||||
sudo chmod a+x "/usr/local/bin/${F}"
|
||||
echo ""
|
||||
done
|
||||
rm -f "${HOME}/.winapps.installed"
|
||||
rm -f "${HOME}/.winapps.installed.bat"
|
||||
|
||||
# Install windows
|
||||
echo -n " Installing Windows..."
|
||||
sudo rm -f "/usr/share/applications/windows.desktop"
|
||||
echo "[Desktop Entry]
|
||||
Name=Windows
|
||||
Exec=${DIR}/bin/winapps windows %F
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Icon=${DIR}/icons/windows.svg
|
||||
StartupWMClass=Micorosoft Windows
|
||||
Comment=Micorosoft Windows
|
||||
Categories=Windows
|
||||
" |sudo tee "/usr/share/applications/windows.desktop" > /dev/null
|
||||
sudo rm -f "/usr/local/bin/windows"
|
||||
echo "#!/usr/bin/env bash
|
||||
${DIR}/bin/winapps windows
|
||||
" |sudo tee "/usr/local/bin/windows" > /dev/null
|
||||
sudo chmod a+x "/usr/local/bin/windows"
|
||||
echo ""
|
||||
|
||||
echo "Installation complete."
|
4
kvm/RDPApps.reg
Normal file
@ -0,0 +1,4 @@
|
||||
Windows Registry Editor Version 5.00
|
||||
|
||||
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList]
|
||||
"fDisabledAllowList"=dword:00000001
|
BIN
kvm/RDPWindows.qcow2
Normal file
173
kvm/RDPWindows.xml
Normal file
@ -0,0 +1,173 @@
|
||||
<domain type='kvm' id='1'>
|
||||
<name>RDPWindows</name>
|
||||
<uuid>ad4c4f80-e908-4b25-afe8-1e915edabf26</uuid>
|
||||
<memory unit='KiB'>4194304</memory>
|
||||
<currentMemory unit='KiB'>4194304</currentMemory>
|
||||
<vcpu placement='static'>2</vcpu>
|
||||
<resource>
|
||||
<partition>/machine</partition>
|
||||
</resource>
|
||||
<os>
|
||||
<type arch='x86_64' machine='pc-i440fx-bionic'>hvm</type>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
<hyperv>
|
||||
<relaxed state='on'/>
|
||||
<vapic state='on'/>
|
||||
<spinlocks state='on' retries='8191'/>
|
||||
</hyperv>
|
||||
<vmport state='off'/>
|
||||
</features>
|
||||
<cpu mode='custom' match='exact' check='full'>
|
||||
<model fallback='forbid'>Haswell-noTSX-IBRS</model>
|
||||
<vendor>Intel</vendor>
|
||||
<feature policy='require' name='vme'/>
|
||||
<feature policy='require' name='ss'/>
|
||||
<feature policy='require' name='vmx'/>
|
||||
<feature policy='require' name='f16c'/>
|
||||
<feature policy='require' name='rdrand'/>
|
||||
<feature policy='require' name='hypervisor'/>
|
||||
<feature policy='require' name='arat'/>
|
||||
<feature policy='require' name='tsc_adjust'/>
|
||||
<feature policy='require' name='umip'/>
|
||||
<feature policy='require' name='md-clear'/>
|
||||
<feature policy='require' name='stibp'/>
|
||||
<feature policy='require' name='arch-capabilities'/>
|
||||
<feature policy='require' name='ssbd'/>
|
||||
<feature policy='require' name='xsaveopt'/>
|
||||
<feature policy='require' name='pdpe1gb'/>
|
||||
<feature policy='require' name='abm'/>
|
||||
<feature policy='require' name='ibpb'/>
|
||||
<feature policy='require' name='amd-ssbd'/>
|
||||
<feature policy='require' name='skip-l1dfl-vmentry'/>
|
||||
</cpu>
|
||||
<clock offset='localtime'>
|
||||
<timer name='rtc' tickpolicy='catchup'/>
|
||||
<timer name='pit' tickpolicy='delay'/>
|
||||
<timer name='hpet' present='no'/>
|
||||
<timer name='hypervclock' present='yes'/>
|
||||
</clock>
|
||||
<on_poweroff>destroy</on_poweroff>
|
||||
<on_reboot>restart</on_reboot>
|
||||
<on_crash>destroy</on_crash>
|
||||
<pm>
|
||||
<suspend-to-mem enabled='no'/>
|
||||
<suspend-to-disk enabled='no'/>
|
||||
</pm>
|
||||
<devices>
|
||||
<emulator>/usr/bin/kvm-spice</emulator>
|
||||
<disk type='file' device='disk'>
|
||||
<driver name='qemu' type='qcow2'/>
|
||||
<source file='RDPWindows.qcow2' index='2'/>
|
||||
<backingStore/>
|
||||
<target dev='hda' bus='ide'/>
|
||||
<alias name='ide0-0-0'/>
|
||||
<address type='drive' controller='0' bus='0' target='0' unit='0'/>
|
||||
</disk>
|
||||
<disk type='file' device='cdrom'>
|
||||
<driver name='qemu'/>
|
||||
<target dev='hdb' bus='ide'/>
|
||||
<readonly/>
|
||||
<alias name='ide0-0-1'/>
|
||||
<address type='drive' controller='0' bus='0' target='0' unit='1'/>
|
||||
</disk>
|
||||
<controller type='usb' index='0' model='ich9-ehci1'>
|
||||
<alias name='usb'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x7'/>
|
||||
</controller>
|
||||
<controller type='usb' index='0' model='ich9-uhci1'>
|
||||
<alias name='usb'/>
|
||||
<master startport='0'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x0' multifunction='on'/>
|
||||
</controller>
|
||||
<controller type='usb' index='0' model='ich9-uhci2'>
|
||||
<alias name='usb'/>
|
||||
<master startport='2'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x1'/>
|
||||
</controller>
|
||||
<controller type='usb' index='0' model='ich9-uhci3'>
|
||||
<alias name='usb'/>
|
||||
<master startport='4'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x05' function='0x2'/>
|
||||
</controller>
|
||||
<controller type='pci' index='0' model='pci-root'>
|
||||
<alias name='pci.0'/>
|
||||
</controller>
|
||||
<controller type='ide' index='0'>
|
||||
<alias name='ide'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
|
||||
</controller>
|
||||
<controller type='virtio-serial' index='0'>
|
||||
<alias name='virtio-serial0'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/>
|
||||
</controller>
|
||||
<interface type='network'>
|
||||
<mac address='52:54:00:c9:22:2c'/>
|
||||
<source network='default' portid='61cf73b8-040c-459f-aac9-8ee598dd52e2' bridge='virbr0'/>
|
||||
<target dev='vnet0'/>
|
||||
<model type='rtl8139'/>
|
||||
<alias name='net0'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
|
||||
</interface>
|
||||
<serial type='pty'>
|
||||
<source path='/dev/pts/0'/>
|
||||
<target type='isa-serial' port='0'>
|
||||
<model name='isa-serial'/>
|
||||
</target>
|
||||
<alias name='serial0'/>
|
||||
</serial>
|
||||
<console type='pty' tty='/dev/pts/0'>
|
||||
<source path='/dev/pts/0'/>
|
||||
<target type='serial' port='0'/>
|
||||
<alias name='serial0'/>
|
||||
</console>
|
||||
<channel type='spicevmc'>
|
||||
<target type='virtio' name='com.redhat.spice.0' state='connected'/>
|
||||
<alias name='channel0'/>
|
||||
<address type='virtio-serial' controller='0' bus='0' port='1'/>
|
||||
</channel>
|
||||
<input type='tablet' bus='usb'>
|
||||
<alias name='input0'/>
|
||||
<address type='usb' bus='0' port='1'/>
|
||||
</input>
|
||||
<input type='mouse' bus='ps2'>
|
||||
<alias name='input1'/>
|
||||
</input>
|
||||
<input type='keyboard' bus='ps2'>
|
||||
<alias name='input2'/>
|
||||
</input>
|
||||
<graphics type='spice' port='5900' autoport='yes' listen='127.0.0.1'>
|
||||
<listen type='address' address='127.0.0.1'/>
|
||||
<image compression='off'/>
|
||||
</graphics>
|
||||
<sound model='ich6'>
|
||||
<alias name='sound0'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
|
||||
</sound>
|
||||
<video>
|
||||
<model type='qxl' ram='65536' vram='65536' vgamem='16384' heads='1' primary='yes'/>
|
||||
<alias name='video0'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
|
||||
</video>
|
||||
<redirdev bus='usb' type='spicevmc'>
|
||||
<alias name='redir0'/>
|
||||
<address type='usb' bus='0' port='2'/>
|
||||
</redirdev>
|
||||
<redirdev bus='usb' type='spicevmc'>
|
||||
<alias name='redir1'/>
|
||||
<address type='usb' bus='0' port='3'/>
|
||||
</redirdev>
|
||||
<memballoon model='virtio'>
|
||||
<alias name='balloon0'/>
|
||||
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
|
||||
</memballoon>
|
||||
</devices>
|
||||
<seclabel type='dynamic' model='dac' relabel='yes'>
|
||||
<label>+385601105:+385600513</label>
|
||||
<imagelabel>+385601105:+385600513</imagelabel>
|
||||
</seclabel>
|
||||
</domain>
|
||||
|