https://github.com/winapps-org/winapps/blob/main/compose.yaml
或者将yaml文件下载到本地windows电脑并上传到debian电脑对于目录下:
scp compose.yaml [email protected]:/home/youxin/winapps
VERSION: "11" #11代表windows11,RAM_SIZE: "4G" # Windows VM的内存大小.CPU_CORES: "4" # Windows VM的 CPU 核心数量.DISK_SIZE: "64G" # 主硬盘大小.USERNAME: "MyWindowsUser" # 访问Windows 的用户名.默认为 'MyWindowsUser'.PASSWORD: "MyWindowsPassword" # 访问Windows 的用户密码.默认为 'MyWindowsPassword'.
二、安装docker
sudo apt remove docker docker-engine docker.io containerd runc
运行sudo apt update,更新apt仓库列表,并安装依赖。
sudo apt updatesudo apt install -y curl gnupg lsb-release
curl -fsSL https://download./linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://mirrors.ustc.edu.cn/docker-ce/linux/debianbookworm stable" |sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
再更新apt软件包索引。
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl start dockersudo systemctl enable docker
将当前用户加入 docker 组
sudo usermod -aG docker $USER
验证是否安装成功
docker --versiondocker info
配置 DNS(防止出现解析失败)
sudo tee /etc/docker/daemon.json > /dev/null <<'EOF'{"dns": ["8.8.8.8", "1.1.1.1"],"log-driver": "json-file","log-opts": {"max-size": "10m","max-file": "3"}}EOF
三、安装Windows VM
重启 Docker
sudo systemctl restart docker
拉取镜像
cd ~/winappsdocker compose --file ./compose.yaml up
由于本次远程安装和连接,因此将127.0.0.1换成主机ip地址。弹出如下安装界面。
连接方式为VNC远程桌面,可以看到Windows11安装进度。完成后显示如下页面。
测试:下载wps并安装,可以正常运行。
后续使用的命令:
docker compose --file ~/.config/winapps/compose.yaml start # Power on the Windows VMdocker compose --file ~/.config/winapps/compose.yaml pause # Pause the Windows VMdocker compose --file ~/.config/winapps/compose.yaml unpause # Resume the Windows VMdocker compose --file ~/.config/winapps/compose.yaml restart # Restart the Windows VMdocker compose --file ~/.config/winapps/compose.yaml stop # Gracefully shut down the Windows VMdocker compose --file ~/.config/winapps/compose.yaml kill # Force shut down the Windows VM
四、安装依赖包,与linux深度集成
apt updatesudo apt install -y curl dialog freerdp3-x11 git iproute2 libnotify-bin netcat-openbsdsudo apt install freerdp3-x11 libfreerdp3-3 freerdp3-dev
五、创建 WinApps 配置文件
创建一个配置文件“~/.config/winapps/winapps.conf”,其中包含内容详见文末。
为了保护您的 Windows 密码不被泄露,请确保只能由您的用户账户访问。
chown $(whoami):$(whoami) ~/.config/winapps/winapps.confchmod 600 ~/.config/winapps/winapps.conf
六、测试 FreeRDP
运行以下命令,其中将/u和/p后面的字符改成windows本地登录用户名和密码。如果不清楚,通过VNC连接修改。
xfreerdp3 /u:"Your Windows Username" /p:"Your Windows Password" /v:192.168.122.2 /cert:tofu
七、运行 WinApps 安装程序
在 Windows 仍处于打开状态的情况下,运行 WinApps 安装程序。
bash <(curl https://raw./winapps-org/winapps/main/setup.sh)
winapps-setup --help
八、缺点https://github.com/winapps-org/winapps

>”~/.config/winapps/winapps.conf”配置文件内容:
################################### WINAPPS CONFIGURATION FILE #################################### INSTRUCTIONS# - Leading and trailing whitespace are ignored.# - Empty lines are ignored.# - Lines starting with '#' are ignored.# - All characters following a '#' are ignored.# [WINDOWS USERNAME]RDP_USER="MyWindowsUser"# [WINDOWS PASSWORD]# NOTES:# - If using FreeRDP v3.9.0 or greater, you *have* to set a passwordRDP_PASS="MyWindowsPassword"# [WINDOWS DOMAIN]# DEFAULT VALUE: '' (BLANK)RDP_DOMAIN=""# [WINDOWS IPV4 ADDRESS]# NOTES:# - If using 'libvirt', 'RDP_IP' will be determined by WinApps at runtime if left unspecified.# DEFAULT VALUE:# - 'docker': '127.0.0.1'# - 'podman': '127.0.0.1'# - 'libvirt': '' (BLANK)RDP_IP="127.0.0.1"# [VM NAME]# NOTES:# - Only applicable when using 'libvirt'# - The libvirt VM name must match so that WinApps can determine VM IP, start the VM, etc.# DEFAULT VALUE: 'RDPWindows'VM_NAME="RDPWindows"# [WINAPPS BACKEND]# DEFAULT VALUE: 'docker'# VALID VALUES:# - 'docker'# - 'podman'# - 'libvirt'# - 'manual'WAFLAVOR="docker"# [DISPLAY SCALING FACTOR]# NOTES:# - If an unsupported value is specified, a warning will be displayed.# - If an unsupported value is specified, WinApps will use the closest supported value.# DEFAULT VALUE: '100'# VALID VALUES:# - '100'# - '140'# - '180'RDP_SCALE="100"# [MOUNTING REMOVABLE PATHS FOR FILES]# NOTES:# - By default, `udisks` (which you most likely have installed) uses /run/media for mounting removable devices.# This improves compatibility with most desktop environments (DEs).# ATTENTION: The Filesystem Hierarchy Standard (FHS) recommends /media instead. Verify your system's configuration.# - To manually mount devices, you may optionally use /mnt.# REFERENCE: https://wiki./title/Udisks#Mount_to_/mediaREMOVABLE_MEDIA="/run/media"# [ADDITIONAL FREERDP FLAGS & ARGUMENTS]# NOTES:# - You can try adding /network:lan to these flags in order to increase performance, however, some users have faced issues with this.# DEFAULT VALUE: '/cert:tofu /sound /microphone +home-drive'# VALID VALUES: See https://github.com/awakecoding/FreeRDP-Manuals/blob/master/User/FreeRDP-User-Manual.markdownRDP_FLAGS="/cert:tofu /sound /microphone +home-drive"# [DEBUG WINAPPS]# NOTES:# - Creates and appends to ~/.local/share/winapps/winapps.log when running WinApps.# DEFAULT VALUE: 'true'# VALID VALUES:# - 'true'# - 'false'DEBUG="true"# [AUTOMATICALLY PAUSE WINDOWS]# NOTES:# - This is currently INCOMPATIBLE with 'manual'.# DEFAULT VALUE: 'off'# VALID VALUES:# - 'on'# - 'off'AUTOPAUSE="off"# [AUTOMATICALLY PAUSE WINDOWS TIMEOUT]# NOTES:# - This setting determines the duration of inactivity to tolerate before Windows is automatically paused.# - This setting is ignored if 'AUTOPAUSE' is set to 'off'.# - The value must be specified in seconds (to the nearest 10 seconds e.g., '30', '40', '50', etc.).# - For RemoteApp RDP sessions, there is a mandatory 20-second delay, so the minimum value that can be specified here is '20'.# - Source: https://techcommunity.microsoft.com/t5/security-compliance-and-identity/terminal-services-remoteapp-8482-session-termination-logic/ba-p/246566# DEFAULT VALUE: '300'# VALID VALUES: >=20AUTOPAUSE_TIME="300"# [FREERDP COMMAND]# NOTES:# - WinApps will attempt to automatically detect the correct command to use for your system.# DEFAULT VALUE: '' (BLANK)# VALID VALUES: The command required to run FreeRDPv3 on your system (e.g., 'xfreerdp', 'xfreerdp3', etc.).FREERDP_COMMAND=""# [TIMEOUTS]# NOTES:# - These settings control various timeout durations within the WinApps setup.# - Increasing the timeouts is only necessary if the corresponding errors occur.# - Ensure you have followed all the Troubleshooting Tips in the error message first.# PORT CHECK# - The maximum time (in seconds) to wait when checking if the RDP port on Windows is open.# - Corresponding error: "NETWORK CONFIGURATION ERROR" (exit status 13).# DEFAULT VALUE: '5'PORT_TIMEOUT="5"# RDP CONNECTION TEST# - The maximum time (in seconds) to wait when testing the initial RDP connection to Windows.# - Corresponding error: "REMOTE DESKTOP PROTOCOL FAILURE" (exit status 14).# DEFAULT VALUE: '30'RDP_TIMEOUT="30"# APPLICATION SCAN# - The maximum time (in seconds) to wait for the script that scans for installed applications on Windows to complete.# - Corresponding error: "APPLICATION QUERY FAILURE" (exit status 15).# DEFAULT VALUE: '60'APP_SCAN_TIMEOUT="60"# WINDOWS BOOT# - The maximum time (in seconds) to wait for the Windows VM to boot if it is not running, before attempting to launch an application.# DEFAULT VALUE: '120'BOOT_TIMEOUT="120"# FREERDP RAIL HIDEF# - This option controls the value of the `hidef` option passed to the /app parameter of the FreeRDP command.# - Setting this option to 'off' may resolve window misalignment issues related to maximized windows.# DEFAULT VALUE: 'on'HIDEF="on"