diff --git a/README.md b/README.md index a4c59682f570e8bde217edfa2e48bf8105ee3522..6dc589683a8ad2e28eccd42419ea39b7295bbd2a 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ # Adapted Version of Winapps to IMGW @UNIVIE +**Be warned this does not work well on Laptop with too little Memory. 4GB for Windows is required.** Run Windows applications (including [Microsoft 365](https://www.microsoft365.com/) and [Adobe Creative Cloud](https://www.adobe.com/creativecloud.html)) on GNU/Linux with `KDE Plasma`, `GNOME` or `XFCE`, integrated seamlessly as if they were native to the OS. @@ -280,12 +281,16 @@ Contributing to the list of supported applications is encouraged through submiss ### IMGW setup -Please folow these steps to make it work: +Please follow these steps to make it work: + 1. install podman and podman compose for the Virtualization of Windows -2. Download preconfigured windows+office image +2. Download preconfigured windows+office image (IMGW only) 3. install winapps on your computer -It is necessary to install podman on your system. +It is necessary to install a container manager (here: podman) on your system. The advantage is that we can use these containers as user, not root required. + +The example here gives commands for Ubuntu, other distributions should work as well. + ```sh # install podman and its dependencies # maybe find information here: https://podman.io/docs/installation @@ -293,6 +298,8 @@ It is necessary to install podman on your system. # for ubuntu: sudo apt-get install podman slirp4netns # install dependencies for winapps (or see below for other distros) + +# if you can not install freerdp3 then use the flatpak version (see below) sudo apt-get install dialog freerdp3-x11 iproute2 libnotify-bin netcat-openbsd # install podman compose script pip3 install --user podman-compose @@ -337,12 +344,33 @@ X/Twitter: @Podman_io Mastodon: @Podman_io@fosstodon.org ``` -now you are ready to download the specific windows and office image +now you are ready to download the specific windows and office image. Open a terminal and run the following commands. + +```sh +# get the bootstrap script and execute +curl -o bootstrap_winapps.sh http://fileserverup.devx1.img.univie.ac.at/bootstrap_winapps.sh +# execute the script using bash in a terminal +bash bootstrap_winapps.sh +# this will do a lot. +``` + +now you should be finished. There should be a few new apps on your desktop: + + +1. WinApps +2. Windows +3. Excel +4. Word +5. Powerpoint +6. Explorer +7. Publisher +The WinApps desktop application is just a wrapper for you to start up and shutdown the windows virtual machine. So what WinApps does, is to launch a VM inside a container and allow forwarding a virtual desktop for just the applications (e.g. Word, ...). They will seem native. +### Normal Setup -### Step 1: Configure a Windows VM +#### Step 1: Configure a Windows VM Both `Docker` and `Podman` are recommended backends for running the Windows virtual machine, as they facilitate an automated Windows installation process. WinApps is also compatible with `libvirt`. While this method requires considerably more manual configuration, it also provides greater virtual machine customisation options. All three methods leverage the `KVM` hypervisor, ensuring excellent virtual machine performance. Ultimately, the choice of backend depends on your specific use case. The following guides are available: @@ -351,7 +379,7 @@ The following guides are available: If you already have a Windows VM or server you wish to use with WinApps, you will need to merge `install/RDPApps.reg` into the Windows Registry manually. -### Step 2: Install Dependencies +#### Step 2: Install Dependencies Install the required dependencies. - Debian/Ubuntu: ```bash @@ -378,7 +406,7 @@ Install the required dependencies. > ``` > However, if you have weird issues like [#233](https://github.com/winapps-org/winapps/issues/233) when running Flatpak, please compile FreeRDP from source according to [this guide](https://github.com/FreeRDP/FreeRDP/wiki/Compilation). -### Step 3: Create a WinApps Configuration File +#### Step 3: Create a WinApps Configuration File Create a configuration file at `~/.config/winapps/winapps.conf` containing the following: ```bash ################################## @@ -488,7 +516,7 @@ FREERDP_COMMAND="" > [!NOTE] > If you wish to use an alternative WinApps backend (other than `Docker`), uncomment and change `WAFLAVOR="docker"` to `WAFLAVOR="podman"` or `WAFLAVOR="libvirt"`. -#### Configuration Options Explained +##### Configuration Options Explained - If using a pre-existing Windows RDP server on your LAN, you must use `RDP_IP` to specify the location of the Windows server. You may also wish to configure a static IP address for this server. - If running a Windows VM using `libvirt` with NAT enabled, leave `RDP_IP` commented out and WinApps will auto-detect the local IP address for the VM. - For domain users, you can uncomment and change `RDP_DOMAIN`. @@ -498,7 +526,7 @@ FREERDP_COMMAND="" - If you enable `DEBUG`, a log will be created on each application start in `~/.local/share/winapps/winapps.log`. - If using a system on which the FreeRDP command is not `xfreerdp` or `xfreerdp3`, the correct command can be specified using `FREERDP_COMMAND`. -### Step 4: Run the WinApps Installer +#### Step 4: Run the WinApps Installer Run the WinApps installer. ```bash bash <(curl https://gitlab.phaidra.org/imgw/winapps/-/raw/main/setup.sh) diff --git a/compose.yaml b/compose.yaml index d5d8c7ff5dbfbc7128b8d5908f559a82cd0a1e27..3bd9357db8319ec3c9a7e6291059d1c81b402093 100644 --- a/compose.yaml +++ b/compose.yaml @@ -6,6 +6,8 @@ # For documentation, FAQ, additional configuration options and technical help, visit: https://github.com/dockur/windows +# Modified for IMGW + name: "winapps" # Docker Compose Project Name. volumes: # Create Volume 'data'. @@ -46,3 +48,8 @@ services: - /dev/kvm # Enable KVM. #- /dev/sdX:/disk1 # Uncomment to mount a disk directly within the Windows VM (Note: 'disk1' will be mounted as the main drive). #- /dev/sdY:/disk2 # Uncomment to mount a disk directly within the Windows VM (Note: 'disk2' and higher will be mounted as secondary drives). + #annotations: + # Maybe this allows the container to be correctly shutdown. + #org.systemd.property.KillMode: "none" + #org.systemd.property.TimeoutStopSec: 420 + diff --git a/icons/winapps-desktop.png b/icons/winapps-desktop.png new file mode 100644 index 0000000000000000000000000000000000000000..c6ca06e9164dc39cfe66dbc6a55ec88d64193b5a Binary files /dev/null and b/icons/winapps-desktop.png differ diff --git a/setup.sh b/setup.sh index 34a04e9ef72ec13a088d0295e897f4ad235272d9..f4b3895da62d008fa1360b8844a3297e4a5dcb04 100755 --- a/setup.sh +++ b/setup.sh @@ -1294,6 +1294,62 @@ Comment=Microsoft Windows RDP Session" echo -e "${DONE_TEXT}Done!${CLEAR_TEXT}" } +# Name: 'waConfigureWinApps' +# Role: Create an application entry for launching the WinApps container +function waConfigureWinApps() { + # Print feedback. + echo -n "Creating an application entry for WinApps... " + + # Declare variables. + local WIN_DESKTOP="" # Stores the '.desktop' file to launch a Windows RDP session. + local WIN_BASH="" # Stores the bash script to launch a Windows RDP session. + + # Determine the compose command. + case "$WAFLAVOR" in + "docker") COMPOSE_COMMAND="docker compose" ;; + "podman") COMPOSE_COMMAND="podman-compose" ;; + esac + WIN_BASH="\ +#!/usr/bin/env bash +if ${WAFAVOR} ps | grep -q 'WinApps'; then + read -p 'WinApps is running. Would you like to stop it? [y/N] ' -r + if [[ \$REPLY =~ ^[Yy]\$ ]]; then + echo 'Stopping WinApps...this might take a bit (up 2min)' + ${COMPOSE_COMMAND} --file ${SOURCE_PATH}/compose.yaml down + fi +else + echo 'Launching WinApps...' + ${COMPOSE_COMMAND} --file ${SOURCE_PATH}/compose.yaml up -d +fi" + + # Populate variables. + WIN_DESKTOP="\ +[Desktop Entry] +Name=WinApps +Exec=${BIN_PATH}/winapps-container +Terminal=false +Type=Application +Icon=${APPDATA_PATH}/icons/winapps.svg +StartupWMClass=Microsoft Windows +Comment=Microsoft Windows RDP Session" + + # Copy the 'Windows' icon. + $SUDO cp "./icons/winapps.svg" "${APPDATA_PATH}/icons/winapps.svg" + + # Write the desktop entry content to a file. + echo "$WIN_DESKTOP" | $SUDO tee "${APP_PATH}/winapps.desktop" &>/dev/null + + # Write the bash script to a file. + echo "$WIN_BASH" | $SUDO tee "${BIN_PATH}/winapps-container" &>/dev/null + + # Mark the bash script as executable. + $SUDO chmod a+x "${BIN_PATH}/winapps-container" + + # Print feedback. + echo -e "${DONE_TEXT}Done!${CLEAR_TEXT}" +} + + # Name: 'waConfigureApp' # Role: Create application entries for a given application installed on Windows. function waConfigureApp() { @@ -1659,6 +1715,7 @@ function waInstall() { # Configure the Windows RDP session application launcher. waConfigureWindows + waConfigureWinApps if [ "$OPT_AOSA" -eq 1 ]; then # Automatically configure all officially supported applications. @@ -1707,7 +1764,7 @@ function waUninstall() { # Remove the 'WinApps' bash scripts. $SUDO rm -f "${BIN_PATH}/winapps" - $SUDO rm -f "${BIN_PATH}/winapps-setup" + # $SUDO rm -f "${BIN_PATH}/winapps-setup" # Remove WinApps configuration data, temporary files and logs. rm -rf "$USER_APPDATA_PATH"