diff --git a/bin/winapps b/bin/winapps index 07cff0d..2486ae7 100755 --- a/bin/winapps +++ b/bin/winapps @@ -370,7 +370,9 @@ function waRunCommand() { /v:"$RDP_IP" &>/dev/null & else # Convert path from UNIX to Windows style. - FILE_PATH=$(echo "$2" | sed 's|'"${HOME}"'|\\\\tsclient\\home|;s|/|\\|g;s|\\|\\\\|g') + FILE_PATH=$(echo "$2" | sed \ + -e 's|'"${HOME}"'|\\\\tsclient\\home|' \ + -e 's|/|\\|g') dprint "UNIX_FILE_PATH: ${2}" dprint "WINDOWS_FILE_PATH: ${FILE_PATH}" diff --git a/docs/libvirt.md b/docs/libvirt.md index 27d2fae..a3aa27f 100644 --- a/docs/libvirt.md +++ b/docs/libvirt.md @@ -45,12 +45,27 @@ Together, these components form a powerful and flexible virtualization stack, wi > `QEMU Guest Agent` is a helper daemon used to exchange information and commands between host and guest operating systems. > You can read more about `QEMU Guest Agent` [here](https://pve.proxmox.com/wiki/Qemu-guest-agent). -5. Download a [Windows 10](https://www.microsoft.com/software-download/windows10ISO) or [Windows 11](https://www.microsoft.com/software-download/windows11) installation `.ISO` image. +5. Configure rootless `libvirt` and `kvm` by adding your user to groups of the same name. + ``` bash + sudo usermod -a -G kvm $(id -un) # Add the user to the 'kvm' group. + sudo usermod -a -G libvirt $(id -un) # Add the user to the 'libvirt' group. + sudo reboot # Reboot the system to ensure the user is added to the relevant groups. + ``` + +6. If relevant to your distribution, disable `AppArmor` for the `libvirt` daemon. + ``` bash + sudo ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/ # Disable AppArmor for the libvirt daemon by creating a symbolic link. + ``` + +> [!NOTE] +> Systems with `SELinux` may also require security policy adjustments if virtual machine images are stored outside the default `/var/lib/libvirt/images` directory. Read [this guide](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/5/html/virtualization/sect-virtualization-security_for_virtualization-selinux_and_virtualization#sect-Virtualization-Security_for_virtualization-SELinux_and_virtualization) for more information. + +7. Download a [Windows 10](https://www.microsoft.com/software-download/windows10ISO) or [Windows 11](https://www.microsoft.com/software-download/windows11) installation `.ISO` image. > [!IMPORTANT] > 'Professional', 'Enterprise' or 'Server' editions of Windows are required to run RDP applications. Windows 'Home' will NOT suffice. -6. Download [VirtIO drivers](https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win.iso) for the Windows virtual machine. +8. Download [VirtIO drivers](https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-virtio/virtio-win.iso) for the Windows virtual machine. > [!NOTE] > VirtIO drivers enhance system performance and minimize overhead by enabling the Windows virtual machine to use specialised network and disk device drivers. These drivers are aware that they are operating inside a virtual machine, and cooperate with the hypervisor. This approach eliminates the need for the hypervisor to emulate physical hardware devices, which is a computationally expensive process. This setup allows guests to achieve high-performance network and disk operations, leveraging the benefits of paravirtualisation. @@ -58,11 +73,6 @@ Together, these components form a powerful and flexible virtualization stack, wi > You can read more about `VirtIO` [here](https://wiki.libvirt.org/Virtio.html) and [here](https://developer.ibm.com/articles/l-virtio/). ## Creating a Windows VM -> [!NOTE] -> If you are an expert user, you may wish to: -> - [Define a Windows virtual machine from an existing `.XML` file](#defining-windows-vm-from-xml) -> - [Configure Rootless `libvirt`](#configuring-rootless-libvirt) - 1. Open `virt-manager`. > [!NOTE] @@ -620,7 +630,7 @@ You can then test whether the host GNU/Linux system can communicate with Windows {"return":{"version":"107.0.1","supported_commands":[{"enabled":true,"name":"guest-get-cpustats","success-response":true},{"enabled":true,"name":"guest-get-diskstats","success-response":true},{"enabled":true,"name":"guest-get-devices","success-response":true},{"enabled":true,"name":"guest-get-osinfo","success-response":true},{"enabled":true,"name":"guest-get-timezone","success-response":true},{"enabled":true,"name":"guest-get-users","success-response":true},{"enabled":true,"name":"guest-get-host-name","success-response":true},{"enabled":true,"name":"guest-exec","success-response":true},{"enabled":true,"name":"guest-exec-status","success-response":true},{"enabled":false,"name":"guest-get-memory-block-info","success-response":true},{"enabled":false,"name":"guest-set-memory-blocks","success-response":true},{"enabled":false,"name":"guest-get-memory-blocks","success-response":true},{"enabled":true,"name":"guest-set-user-password","success-response":true},{"enabled":true,"name":"guest-get-fsinfo","success-response":true},{"enabled":true,"name":"guest-get-disks","success-response":true},{"enabled":false,"name":"guest-set-vcpus","success-response":true},{"enabled":true,"name":"guest-get-vcpus","success-response":true},{"enabled":true,"name":"guest-network-get-interfaces","success-response":true},{"enabled":false,"name":"guest-suspend-hybrid","success-response":false},{"enabled":true,"name":"guest-suspend-ram","success-response":false},{"enabled":true,"name":"guest-suspend-disk","success-response":false},{"enabled":true,"name":"guest-fstrim","success-response":true},{"enabled":true,"name":"guest-fsfreeze-thaw","success-response":true},{"enabled":true,"name":"guest-fsfreeze-freeze-list","success-response":true},{"enabled":true,"name":"guest-fsfreeze-freeze","success-response":true},{"enabled":true,"name":"guest-fsfreeze-status","success-response":true},{"enabled":true,"name":"guest-file-flush","success-response":true},{"enabled":true,"name":"guest-file-seek","success-response":true},{"enabled":true,"name":"guest-file-write","success-response":true},{"enabled":true,"name":"guest-file-read","success-response":true},{"enabled":true,"name":"guest-file-close","success-response":true},{"enabled":true,"name":"guest-file-open","success-response":true},{"enabled":true,"name":"guest-shutdown","success-response":false},{"enabled":true,"name":"guest-info","success-response":true},{"enabled":true,"name":"guest-set-time","success-response":true},{"enabled":true,"name":"guest-get-time","success-response":true},{"enabled":true,"name":"guest-ping","success-response":true},{"enabled":true,"name":"guest-sync","success-response":true},{"enabled":true,"name":"guest-sync-delimited","success-response":true}]}} ``` -Next, you will need to make some registry changes to enable RDP Applications to run on the system. Start by downloading the [RDPApps.reg](/install/RDPApps.reg) file, right-clicking on the `Raw` button, and clicking on `Save target as`. +Next, you will need to make some registry changes to enable RDP Applications to run on the system. Start by downloading the [RDPApps.reg](https://github.com/winapps-org/winapps/blob/main/oem/RDPApps.reg) file, right-clicking on the `Raw` button, and clicking on `Save target as`.

@@ -671,36 +681,3 @@ Finally, restart the virtual machine, but **DO NOT** log in. Close the virtual m ```bash ./installer.sh ``` - -## Expert Installations -### Defining Windows VM from `.XML` -This expert guide for `.XML` imports is specific to Ubuntu 20.04 and may not work on all hardware platforms. Please read this guide in conjunction with the steps outlined above. - -1. Copy your Windows `.ISO` and `VirtIO` drivers `.ISO` files into the desired folder, updating the relevant paths in `kvm/RDPWindows.xml`. - -2. Define a virtual machine called 'RDPWindows' from the sample XML file. - ``` bash - virsh define kvm/RDPWindows.xml - virsh autostart RDPWindows # Configure the VM to start automatically when the host machine boots - ``` - -3. Open the virtual machine's properties in `virt-manager` and ensure that `Copy host CPU configuration` is enabled. - -4. Boot the virtual machine, install Windows and complete the final configuration steps as outlined in the main guide above. - -### Configuring Rootless `libvirt` -By default, `libvirt` requires sudo to run virtual machines. To enable your user to access `libvirt` and `kvm` without sudo, your user must be added to groups of the same name. Furthermore, modifications need to be made to `AppArmor` (if relevant to your distribution). - -``` bash -sudo sed -i "s/#user = "root"/user = "$(id -un)"/g" /etc/libvirt/qemu.conf # Uncomment the user = "root" line and replace root with the current username. -sudo sed -i "s/#group = "root"/group = "$(id -gn)"/g" /etc/libvirt/qemu.conf # Uncomment the group = "root" line and replace root with the current user's primary group. -sudo usermod -a -G kvm $(id -un) # Add the user to the 'kvm' group. -sudo usermod -a -G libvirt $(id -un) # Add the user to the 'libvirt' group. -sudo systemctl restart libvirtd # Restart the libvirt daemon. -sudo ln -s /etc/apparmor.d/usr.sbin.libvirtd /etc/apparmor.d/disable/ # Disable AppArmor for the libvirt daemon by creating a symbolic link. -``` - -You will need to reboot your system to ensure your user is added to the relevant groups. - -> [!NOTE] -> Systems with `SELinux` may also require security policy adjustments to enable correct functioning of the `libvirt` daemon. diff --git a/docs/libvirt_images/Virtualisation_Stack.svg b/docs/libvirt_images/Virtualisation_Stack.svg index b522006..9ebb272 100644 --- a/docs/libvirt_images/Virtualisation_Stack.svg +++ b/docs/libvirt_images/Virtualisation_Stack.svg @@ -1,180 +1,562 @@ - - Open-source-virtualization-stack -