Jump to content

Hello visitors, welcome to the Hacker World Forum!

Red Team 1949  (formerly CHT Attack and Defense Team) In this rapidly changing Internet era, we maintain our original intention and create the best community to jointly exchange network technologies. You can obtain hacker attack and defense skills and knowledge in the forum, or you can join our Telegram communication group to discuss and communicate in real time. All kinds of advertisements are prohibited in the forum. Please register as a registered user to check our usage and privacy policy. Thank you for your cooperation.

TheHackerWorld Official

WinApps - Linux平台下运行Windows程序

Featured Replies

Posted

WinApps - 在 Linux 平台上运行 Windows 程序

2025年9月15日马云惹不起马云

Tilt

前言

我的主要办公电脑是Arch Linux,所以我在工作过程中不可避免地需要使用Windows应用程序工具,但是它们在Linux生态系统中不可用,所以我寻找了一些解决方案,看看是否可以在Linux下无缝运行Windows程序。我第一次接触葡萄酒是在很多年前。这款软件虚拟了一个Windows运行环境,但是会安装很多依赖,稳定性有待质疑。最终我选择了开源项目WinApps,它不需要我在Linux上安装太多软件。只需要依赖一个RDP客户端(freerdp)和虚拟化技术软件(Podman/Docker/Libvrt)。

环境设置流程

WinApps是一个开源项目,Github链接:

https://github.com/winapps-org/winapps/tree/main

WinApps项目的原理其实很简单。就是在虚拟化软件上创建一个Windows虚拟机,然后启动RDP(远程桌面)服务,然后通过简单的配置使用RDP客户端快速连接到虚拟机。最终我选择了Libvrt作为底层虚拟化的基础。我认为Docker更适合运行一些轻量级应用程序,而不适合在其之上启动操作系统。我有轻微的洁癖。

步骤一:创建虚拟机

文档链接:https://github.com/winapps-org/winapps/blob/main/docs/libvirt.md

第二步:安装客户端依赖的工具

sudo pacman -Syu --needed -y curl 对话框freerdp git iproute2 libnotify openbsd-netcat

第三步:创建配置文件

我有两台虚拟机,一台用于办公,一台用于开发(Visual Studio)

╭─arch@archlinux ~

╰─$ virsh 列表--all

ID 名称状态

--------------------------

1 RDPWindows 运行

3 Win10运行

配置文件:$HOME/.config/winapps/winapps.conf

RDP_USER='用户名'

RDP_PASS='密码'

RDP_IP='192.168.0.1'

# 缩放比例,高分辨率大显示需要调整,默认值100

RDP_SCALE=140

WAFLAVOR='libvirt'

RDP_超时=60

调试='真'

#挂载主目录

RDP_FLAGS='+主驱动器'

在此步骤中,我读取了WinApps 脚本文件:https://github.com/winapps-org/winapps/blob/main/bin/winapps

对脚本进行了一些优化,以便我可以连接多个虚拟机。

配置文件:$HOME/.config/winapps/winapps-dev.conf

# 连接的主机名需要与virsh 列出的主机名相同

VM_NAME='Win10'

RDP_USER='用户名'

RDP_PASS='密码'

RDP_IP='192.168.0.1'

# 缩放比例,高分辨率大显示需要调整,默认值100

RDP_SCALE=140

WAFLAVOR='libvirt'

RDP_超时=60

调试='真'

#挂载主目录

RDP_FLAGS='+home-drive /cert:ignore'

只需在第39 行添加新行:

第:章

然后创建一个Desktop文件,以便Drun可以直接检索它:

╭─arch@archlinux ~

╰─$ cat ~/.local/share/applications/windows.desktop

[桌面入口]

名称=Windows

Exec=env LIBVIRT_DEFAULT_URI=qemu:///system /home/arch/.local/bin/winapps windows %F

终端=假

类型=应用

图标=/home/arch/.local/share/winapps/icons/windows.svg

StartupWMClass=Microsoft Windows

评论=Microsoft Windows RDP 会话

╰─$ cat ~/.local/share/applications/windows-dev.desktop

[桌面入口]

名称=Windows 开发人员

Exec=env LIBVIRT_DEFAULT_URI=qemu:///system CONFIG_PATH=/home/arch/.config/winapps/winapps-dev.conf /home/arch/.local/bin/winapps windows %F

终端=假

类型=应用

图标=/home/arch/.local/share/winapps/icons/windows.svg

StartupWMClass=Microsoft Windows

评论=Microsoft Windows RDP 会话

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.