mirror of
https://github.com/winapps-org/winapps.git
synced 2025-06-02 13:17:19 +02:00
Added instructions for Podman.
This commit is contained in:
parent
c62391abff
commit
8fbf074307
@ -256,7 +256,11 @@ function waCheckContainerRunning() {
|
||||
local CONTAINER_STATE=""
|
||||
|
||||
# Determine container state.
|
||||
CONTAINER_STATE=$(docker ps --filter name="WinApps" --format '{{.Status}}')
|
||||
if command -v docker &>/dev/null; then
|
||||
CONTAINER_STATE=$(docker ps --filter name="WinApps" --format '{{.Status}}')
|
||||
else
|
||||
CONTAINER_STATE=$(podman ps --filter name="WinApps" --format '{{.Status}}')
|
||||
fi
|
||||
CONTAINER_STATE=${CONTAINER_STATE,,} # Convert the string to lowercase.
|
||||
CONTAINER_STATE=${CONTAINER_STATE%% *} # Extract the first word.
|
||||
|
||||
|
143
docs/docker.md
143
docs/docker.md
@ -1,93 +1,84 @@
|
||||
# Creating a Virtual Machine in Docker
|
||||
# Creating a Windows VM in `Docker` or `Podman`
|
||||
Although WinApps supports using `QEMU+KVM+libvirt` as a backend for running Windows virtual machines, it is recommended to use `Docker` or `Podman`. These backends automate the setup process, eliminating the need for manual configuration and optimisation of the Windows virtual machine.
|
||||
|
||||
## Why Docker?
|
||||
> [!IMPORTANT]
|
||||
Running a Windows virtual machine using `Docker` or `Podman` as a backend is only possible on GNU/Linux systems. This is due to the necessity of kernel interfaces, such as the KVM hypervisor, for achieving acceptable performance. The performance of the virtual machine can vary based on the version of the Linux kernel, with newer releases generally offering better performance.
|
||||
|
||||
While working with `virsh` is completely fine for WinApps, you have to set up and optimize your VM manually.
|
||||
Docker, on the other hand, sets up most of the stuff automatically and makes the VM highly portable between Linux distros.
|
||||
> [!IMPORTANT]
|
||||
> WinApps does NOT officially support versions of Windows prior to Windows 10. Despite this, it may be possible to achieve a successful installation with some additional experimentation. If you find a way to achieve this, please share your solution through a pull request for the benefit of other users.
|
||||
|
||||
# Requirements
|
||||
## `Docker`
|
||||
### Installation
|
||||
You can find a guide for installing `Docker Engine` [here](https://docs.docker.com/engine/install/).
|
||||
|
||||
Since Docker manages the dependencies of the container automatically, you only need to install Docker itself.
|
||||
### Setup `Docker` Container
|
||||
WinApps utilises `docker compose` to configure Windows VMs. A suitable [`compose.yaml`](https://github.com/winapps-org/winapps/blob/main/compose.yaml) file is included in the root directory of the WinApps repository.
|
||||
|
||||
You can try using Podman too because of their faster container startup times,
|
||||
but note that Podman and Docker aren't always fully interchangeable. In case you want to follow this guide using Podman,
|
||||
you will have to install the `docker` CLI to be able to run `docker compose` commands.
|
||||
You will also have to enable the Podman socket. Refer to the Podman docs for how to do that.
|
||||
Prior to initiating the installation, you can modify the RAM and number of CPU cores available to the Windows VM by changing `RAM_SIZE` and `CPU_CORES` within `compose.yaml`.
|
||||
|
||||
See:
|
||||
|
||||
- [Podman installation docs](https://podman.io/docs/installation)
|
||||
- [Docker installation docs](https://docs.docker.com/engine/install)
|
||||
- [Using `docker compose` with Podman](https://www.redhat.com/sysadmin/podman-docker-compose) (slightly outdated)
|
||||
It is also possible to specify the version of Windows you wish to install within `compose.yaml` by modifying `VERSION`.
|
||||
|
||||
> [!NOTE]
|
||||
> This will only work on Linux systems since the VM needs some kernel interfaces (like KVM). Because of this,
|
||||
> performance can vary depending on kernel version (newer will likely perform better).
|
||||
> WinApps uses a stripped-down Windows installation by default. Although this is recommended, you can request a stock Windows installation by changing `VERSION` to one of the versions listed in the README of the [original GitHub repository](https://github.com/dockur/windows).
|
||||
|
||||
# Setup Docker Container
|
||||
Please refer to the [original GitHub repository](https://github.com/dockur/windows) for more information on additional configuration options.
|
||||
|
||||
The easiest way to set up a Windows VM is by using docker compose. A compose file that looks like this is already shipped with WinApps:
|
||||
|
||||
```yaml
|
||||
name: "winapps"
|
||||
|
||||
volumes:
|
||||
data:
|
||||
|
||||
services:
|
||||
windows:
|
||||
image: dockurr/windows
|
||||
container_name: windows
|
||||
environment:
|
||||
VERSION: "tiny11"
|
||||
RAM_SIZE: "4G"
|
||||
CPU_CORES: "4"
|
||||
privileged: true
|
||||
ports:
|
||||
- 8006:8006
|
||||
- 3389:3389/tcp
|
||||
- 3389:3389/udp
|
||||
stop_grace_period: 2m
|
||||
restart: on-failure
|
||||
volumes:
|
||||
- data:/storage
|
||||
### Installing Windows
|
||||
After navigating into the cloned WinApps repository, you can initiate the Windows installation using `docker compose`.
|
||||
```bash
|
||||
docker compose up
|
||||
```
|
||||
|
||||
Now you can tune the RAM/usage by changing `RAM_SIZE` & `CPU_CORES`. You can also specify
|
||||
the Windows versions you want to use. You might also want to take a look at the [repo of the Docker image](https://github.com/dockur/windows) for further information.
|
||||
You can then access the Windows virtual machine via a VNC connection to complete the Windows setup by navigating to http://127.0.0.1:8006 in your web browser.
|
||||
|
||||
This compose file uses Windows 11 by default. You can use Windows 10 by changing the `VERSION` to `tiny10`.
|
||||
### Installing WinApps
|
||||
`Docker` simplifies the WinApps installation process by eliminating the need for any additional configuration of the Windows virtual machine. Once the Windows virtual machine is up and running, you can directly launch the WinApps installer, which should automatically detect and interface with Windows.
|
||||
|
||||
```bash
|
||||
./installer.sh
|
||||
```
|
||||
|
||||
### Subsequent Use
|
||||
```bash
|
||||
docker compose start # Power on the Windows VM
|
||||
docker compose pause # Pause the Windows VM
|
||||
docker compose unpause # Resume the Windows VM
|
||||
docker compose restart # Restart the Windows VM
|
||||
docker compose stop # Gracefully shut down the Windows VM
|
||||
docker compose kill # Force shut down the Windows VM
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> We use a stripped-down Windows installation by default. This is recommended,
|
||||
> but you can still opt for stock Windows by changing the version to one of the versions listed in
|
||||
> the README of the images repository linked above.
|
||||
> The above `docker compose` commands must be run within the same directory containing `compose.yaml`.
|
||||
|
||||
## `Podman`
|
||||
### Installation
|
||||
1. Install `Podman` using [this guide](https://podman.io/docs/installation).
|
||||
2. Install `podman-compose` using [this guide](https://github.com/containers/podman-compose?tab=readme-ov-file#installation).
|
||||
|
||||
### Setup `Podman` Container
|
||||
Please follow the [`docker` instructions](#setup-docker-container).
|
||||
|
||||
### Installing Windows
|
||||
After navigating into the cloned WinApps repository, you can initiate the Windows installation using `podman-compose`.
|
||||
```bash
|
||||
podman-compose up
|
||||
```
|
||||
|
||||
You can then access the Windows virtual machine via a VNC connection to complete the Windows setup by navigating to http://127.0.0.1:8006 in your web browser.
|
||||
|
||||
### Installing WinApps
|
||||
Please follow the [`docker` instructions](#installing-winapps).
|
||||
|
||||
### Subsequent Use
|
||||
```bash
|
||||
podman-compose start # Power on the Windows VM
|
||||
podman-compose pause # Pause the Windows VM
|
||||
podman-compose unpause # Resume the Windows VM
|
||||
podman-compose restart # Restart the Windows VM
|
||||
podman-compose stop # Gracefully shut down the Windows VM
|
||||
podman-compose kill # Force shut down the Windows VM
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> We don't officially support older versions than Windows 10. However, they might still work with some additional tuning.
|
||||
|
||||
You can now just run:
|
||||
|
||||
```shell
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
to run the VM in the background.
|
||||
|
||||
After this, just open http://127.0.0.1:8006 in your web browser and wait for the Windows installation to finish.
|
||||
|
||||
Now you should be ready to go and try to connect to your VM with WinApps.
|
||||
|
||||
For stopping the VM, just use:
|
||||
|
||||
```shell
|
||||
docker compose stop
|
||||
```
|
||||
|
||||
For starting again afterward, use:
|
||||
|
||||
```shell
|
||||
docker compose start
|
||||
```
|
||||
|
||||
(All compose commands have to be run from the directory where `compose.yaml` is located.)
|
||||
> The above `podman-compose` commands must be run within the same directory containing `compose.yaml`.
|
||||
|
12
installer.sh
12
installer.sh
@ -586,7 +586,7 @@ function waCheckDependencies() {
|
||||
return "$EC_MISSING_DEPS"
|
||||
fi
|
||||
elif [ "$WAFLAVOR" = "docker" ]; then
|
||||
if ! command -v docker &>/dev/null; then
|
||||
if ! command -v docker &>/dev/null && ! command -v podman-compose &>/dev/null; then
|
||||
# Complete the previous line.
|
||||
echo -e "${FAIL_TEXT}Failed!${CLEAR_TEXT}\n"
|
||||
|
||||
@ -594,11 +594,13 @@ function waCheckDependencies() {
|
||||
echo -e "${ERROR_TEXT}ERROR:${CLEAR_TEXT} ${BOLD_TEXT}MISSING DEPENDENCIES.${CLEAR_TEXT}"
|
||||
|
||||
# Display the error details.
|
||||
echo -e "${INFO_TEXT}Please install 'Docker Engine' to proceed.${CLEAR_TEXT}"
|
||||
echo -e "${INFO_TEXT}Please install 'Docker Engine' OR 'podman' and 'podman-compose' to proceed.${CLEAR_TEXT}"
|
||||
|
||||
# Display the suggested action(s).
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
echo "Please visit https://docs.docker.com/engine/install/ for more information."
|
||||
echo "Please visit https://podman.io/docs/installation for more information."
|
||||
echo "Please visit https://github.com/containers/podman-compose for more information."
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
|
||||
# Terminate the script.
|
||||
@ -728,7 +730,11 @@ function waCheckContainerRunning() {
|
||||
local CONTAINER_STATE=""
|
||||
|
||||
# Determine container state.
|
||||
CONTAINER_STATE=$(docker ps --filter name="WinApps" --format '{{.Status}}')
|
||||
if command -v docker &>/dev/null; then
|
||||
CONTAINER_STATE=$(docker ps --filter name="WinApps" --format '{{.Status}}')
|
||||
else
|
||||
CONTAINER_STATE=$(podman ps --filter name="WinApps" --format '{{.Status}}')
|
||||
fi
|
||||
CONTAINER_STATE=${CONTAINER_STATE,,} # Convert the string to lowercase.
|
||||
CONTAINER_STATE=${CONTAINER_STATE%% *} # Extract the first word.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user