From 844f7094808c48f4a73d4c81faf60eef8252d948 Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Sat, 11 Nov 2023 21:26:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E7=AB=AF=E5=8F=A3=E8=BD=AC?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- StartVM.sh | 12 ++-- VM-source/QemuSystemInstall.sh | 6 ++ VM-source/StartVM.sh | 109 +++++++++++++++++++++++++++++++++ VM-source/qemu.cpp | 12 ++-- 4 files changed, 127 insertions(+), 12 deletions(-) create mode 100755 VM-source/QemuSystemInstall.sh create mode 100755 VM-source/StartVM.sh diff --git a/StartVM.sh b/StartVM.sh index a8fc9d2..a13023a 100755 --- a/StartVM.sh +++ b/StartVM.sh @@ -51,11 +51,11 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then ./VM/kvm-ok if [[ $? == 0 ]] && [[ `arch` == "x86_64" ]]; then echo X86 架构,使用 kvm 加速 - qemu-system-x86_64 --enable-kvm -cpu host --hda "$HOME/Qemu/Windows/Windows.qcow2" -soundhw all -smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) -m ${use}G -net user,hostfwd=tcp::3389-:3389 -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI > /tmp/windows-virtual-machine-installer-for-wine-runner-run.log 2>&1 + qemu-system-x86_64 --enable-kvm -cpu host --hda "$HOME/Qemu/Windows/Windows.qcow2" -soundhw all -smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) -m ${use}G -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI > /tmp/windows-virtual-machine-installer-for-wine-runner-run.log 2>&1 exit fi echo 不使用 kvm 加速 - qemu-system-x86_64 --hda "$HOME/Qemu/Windows/Windows.qcow2" -soundhw all -smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) -m ${use}G -net user,hostfwd=tcp::3389-:3389 -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI > /tmp/windows-virtual-machine-installer-for-wine-runner-run.log 2>&1 + qemu-system-x86_64 --hda "$HOME/Qemu/Windows/Windows.qcow2" -soundhw all -smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) -m ${use}G -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI > /tmp/windows-virtual-machine-installer-for-wine-runner-run.log 2>&1 exit fi cat ~/.config/deepin-wine-runner/QEMU-ARCH | grep armhf @@ -72,10 +72,10 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then echo $qemuUEFI ./VM/kvm-ok if [[ $? == 0 ]] && [[ `arch` == "aarch64" ]]; then - qemu-system-arm --enable-kvm --hda "$HOME/Qemu/Windows/Windows.qcow2" -soundhw all -smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) -m ${use}G -net user,hostfwd=tcp::3389-:3389 -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI -cpu max -M virt -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 + qemu-system-arm --enable-kvm --hda "$HOME/Qemu/Windows/Windows.qcow2" -soundhw all -smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) -m ${use}G -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI -cpu max -M virt -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 exit fi - qemu-system-arm --hda "$HOME/Qemu/Windows/Windows.qcow2" -soundhw all -smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) -m ${use}G -net user,hostfwd=tcp::3389-:3389 -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI -cpu max -M virt -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 + qemu-system-arm --hda "$HOME/Qemu/Windows/Windows.qcow2" -soundhw all -smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) -m ${use}G -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI -cpu max -M virt -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 exit fi cat ~/.config/deepin-wine-runner/QEMU-ARCH | grep aarch64 @@ -92,10 +92,10 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then echo $qemuUEFI ./VM/kvm-ok if [[ $? == 0 ]] && [[ `arch` == "aarch64" ]]; then - qemu-system-aarch64 --enable-kvm --hda "$HOME/Qemu/Windows/Windows.qcow2" -soundhw all -smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) -m ${use}G -net user,hostfwd=tcp::3389-:3389 -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI -cpu max -M virt -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 + qemu-system-aarch64 --enable-kvm --hda "$HOME/Qemu/Windows/Windows.qcow2" -soundhw all -smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) -m ${use}G -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI -cpu max -M virt -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 exit fi - qemu-system-aarch64 --hda "$HOME/Qemu/Windows/Windows.qcow2" -soundhw all -smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) -m ${use}G -net user,hostfwd=tcp::3389-:3389 -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI -cpu max -M virt -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 + qemu-system-aarch64 --hda "$HOME/Qemu/Windows/Windows.qcow2" -soundhw all -smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) -m ${use}G -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI -cpu max -M virt -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 exit fi diff --git a/VM-source/QemuSystemInstall.sh b/VM-source/QemuSystemInstall.sh new file mode 100755 index 0000000..38f3e9a --- /dev/null +++ b/VM-source/QemuSystemInstall.sh @@ -0,0 +1,6 @@ +#!/bin/bash +sudo apt update +sudo apt install qemu-system qemu-user qemu-efi qemu-efi-aarch64 qemu-efi-arm -y +sudo apt install qemu-user-static binfmt-support qemu-system-gui -y +echo 安装完成!按回车键退出 +read diff --git a/VM-source/StartVM.sh b/VM-source/StartVM.sh new file mode 100755 index 0000000..a8fc9d2 --- /dev/null +++ b/VM-source/StartVM.sh @@ -0,0 +1,109 @@ +#!/bin/bash +# 使用系统默认的 bash 运行 +########################################################################################### +# 作者:gfdgd xi +# 版本:1.7.0 +# 更新时间:2022年07月15日 +# 感谢:感谢 wine 以及 deepin-wine 团队,提供了 wine 和 deepin-wine 给大家使用,让我能做这个程序 +# 基于 Python3 的 tkinter 构建 +########################################################################################### +cd `dirname $0` +VBoxManage showvminfo Windows +if [[ 0 == $? ]]; then + # 检测到虚拟机存在,启动虚拟机 + VBoxManage startvm Windows > /tmp/windows-virtual-machine-installer-for-wine-runner-run.log 2>&1 + exit +fi +# 检查是否有 QEMU +which qemu-system-x86_64 +if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then + if [[ -f "$HOME/.config/deepin-wine-runner/QemuSetting.json" ]]; then + echo 有设置文件,读设置文件 + cd `dirname $0` + python3 ./VM/StartQemu.py + exit + fi + # 查看CPU个数 + CpuSocketNum=`cat /proc/cpuinfo | grep "cpu cores" | uniq | wc -l` + # 查看CPU核心数 + CpuCoreNum=`grep 'core id' /proc/cpuinfo | sort -u | wc -l` + # 查看逻辑CPU的个数 + CpuCount=`cat /proc/cpuinfo| grep "processor"| wc -l` + + # 总内存大小GB + MemTotal=`awk '($1 == "MemTotal:"){printf "%.2f\n",$2/1024/1024}' /proc/meminfo` + use=$(echo "scale=4; $MemTotal / 3" | bc) + + cat ~/.config/deepin-wine-runner/QEMU-ARCH | grep amd64 + if [[ $? == 0 ]] || [[ ! -e ~/.config/deepin-wine-runner/QEMU-ARCH ]]; then + # amd64 架构 + if [[ -f $HOME/.config/deepin-wine-runner/QEMU-EFI ]]; then + echo 使用 UEFI 启动 + if [[ -f /usr/share/qemu/OVMF.fd ]]; then + qemuUEFI="--bios /usr/share/qemu/OVMF.fd" + else + if [[ -f `dirname $0`/VM/OVMF.fd ]]; then + qemuUEFI="--bios `dirname $0`/VM/OVMF.fd" + fi + fi + echo $qemuUEFI + fi + ./VM/kvm-ok + if [[ $? == 0 ]] && [[ `arch` == "x86_64" ]]; then + echo X86 架构,使用 kvm 加速 + qemu-system-x86_64 --enable-kvm -cpu host --hda "$HOME/Qemu/Windows/Windows.qcow2" -soundhw all -smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) -m ${use}G -net user,hostfwd=tcp::3389-:3389 -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI > /tmp/windows-virtual-machine-installer-for-wine-runner-run.log 2>&1 + exit + fi + echo 不使用 kvm 加速 + qemu-system-x86_64 --hda "$HOME/Qemu/Windows/Windows.qcow2" -soundhw all -smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) -m ${use}G -net user,hostfwd=tcp::3389-:3389 -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI > /tmp/windows-virtual-machine-installer-for-wine-runner-run.log 2>&1 + exit + fi + cat ~/.config/deepin-wine-runner/QEMU-ARCH | grep armhf + if [[ $? == 0 ]]; then + # armhf 架构 + # 寻找 UEFI 固件 + if [[ -f /usr/share/AAVMF/AAVMF32_CODE.fd ]]; then + qemuUEFI="--bios /usr/share/AAVMF/AAVMF32_CODE.fd" + else + if [[ -f ./VM/AAVMF32_CODE.fd ]]; then + qemuUEFI="--bios ./VM/AAVMF32_CODE.fd" + fi + fi + echo $qemuUEFI + ./VM/kvm-ok + if [[ $? == 0 ]] && [[ `arch` == "aarch64" ]]; then + qemu-system-arm --enable-kvm --hda "$HOME/Qemu/Windows/Windows.qcow2" -soundhw all -smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) -m ${use}G -net user,hostfwd=tcp::3389-:3389 -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI -cpu max -M virt -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 + exit + fi + qemu-system-arm --hda "$HOME/Qemu/Windows/Windows.qcow2" -soundhw all -smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) -m ${use}G -net user,hostfwd=tcp::3389-:3389 -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI -cpu max -M virt -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 + exit + fi + cat ~/.config/deepin-wine-runner/QEMU-ARCH | grep aarch64 + if [[ $? == 0 ]]; then + # aarch64 架构 + # 寻找 UEFI 固件 + if [[ -f /usr/share/qemu-efi-aarch64/QEMU_EFI.fd ]]; then + qemuUEFI="--bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd" + else + if [[ -f ./VM/QEMU_AARCH64_EFI.fd ]]; then + qemuUEFI="--bios ./VM/QEMU_AARCH64_EFI.fd" + fi + fi + echo $qemuUEFI + ./VM/kvm-ok + if [[ $? == 0 ]] && [[ `arch` == "aarch64" ]]; then + qemu-system-aarch64 --enable-kvm --hda "$HOME/Qemu/Windows/Windows.qcow2" -soundhw all -smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) -m ${use}G -net user,hostfwd=tcp::3389-:3389 -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI -cpu max -M virt -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 + exit + fi + qemu-system-aarch64 --hda "$HOME/Qemu/Windows/Windows.qcow2" -soundhw all -smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) -m ${use}G -net user,hostfwd=tcp::3389-:3389 -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI -cpu max -M virt -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 + exit + fi + +fi +zenity --question --no-wrap --text="检查到您未创建所指定的虚拟机,是否创建虚拟机并继续?\n如果不创建将无法使用" +if [[ 1 == $? ]]; then + # 用户不想创建虚拟机,结束 + exit +fi + +./VM/VirtualMachine diff --git a/VM-source/qemu.cpp b/VM-source/qemu.cpp index 5dc52f4..3889444 100644 --- a/VM-source/qemu.cpp +++ b/VM-source/qemu.cpp @@ -82,16 +82,16 @@ int qemu::MountMainDisk(QString diskPath){ int qemu::StartArmhf(){ qDebug() << commandOption; if(Command().GetCommand("arch").replace("\n", "").replace(" ", "") == "aarch64" && !system((QCoreApplication::applicationDirPath() + "/kvm-ok").toUtf8())){ - return system(("qemu-system-arm -net user,hostfwd=tcp::3389-:3389 -display vnc=:5 -display gtk --enable-kvm -cpu host -M virt " + commandOption + " -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 &").toLatin1()); + return system(("qemu-system-arm -display vnc=:5 -display gtk --enable-kvm -cpu host -M virt " + commandOption + " -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 &").toLatin1()); } - return system(("qemu-system-arm -net user,hostfwd=tcp::3389-:3389 -display vnc=:5 -display gtk -cpu max -M virt " + commandOption + " -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 &").toLatin1()); + return system(("qemu-system-arm -display vnc=:5 -display gtk -cpu max -M virt " + commandOption + " -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 &").toLatin1()); } int qemu::StartAarch64(){ qDebug() << commandOption; if(Command().GetCommand("arch").replace("\n", "").replace(" ", "") == "aarch64" && !system((QCoreApplication::applicationDirPath() + "/kvm-ok").toUtf8())){ - return system(("qemu-system-aarch64 -net user,hostfwd=tcp::3389-:3389 -display vnc=:5 -display gtk --enable-kvm -cpu host -M virt " + commandOption + " -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 &").toLatin1()); + return system(("qemu-system-aarch64 -display vnc=:5 -display gtk --enable-kvm -cpu host -M virt " + commandOption + " -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 &").toLatin1()); } - return system(("qemu-system-aarch64 -net user,hostfwd=tcp::3389-:3389 -display vnc=:5 -display gtk -cpu max -M virt " + commandOption + " -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 &").toLatin1()); + return system(("qemu-system-aarch64 -display vnc=:5 -display gtk -cpu max -M virt " + commandOption + " -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 &").toLatin1()); } int qemu::StartLoong64(){ @@ -99,9 +99,9 @@ int qemu::StartLoong64(){ int qemu::Start(bool unShown){ qDebug() << commandOption; if(Command().GetCommand("arch").replace("\n", "").replace(" ", "") == "x86_64" && !system((QCoreApplication::applicationDirPath() + "/kvm-ok").toUtf8())){ - return system(("qemu-system-x86_64 -net user,hostfwd=tcp::3389-:3389 -display vnc=:5 -display gtk --enable-kvm -cpu host " + commandOption + " > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 &").toLatin1()); + return system(("qemu-system-x86_64 -display vnc=:5 -display gtk --enable-kvm -cpu host " + commandOption + " > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 &").toLatin1()); } - return system(("qemu-system-x86_64 -net user,hostfwd=tcp::3389-:3389 -display vnc=:5 -display gtk -nic model=rtl8139 " + commandOption + " > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 &").toLatin1()); + return system(("qemu-system-x86_64 -display vnc=:5 -display gtk -nic model=rtl8139 " + commandOption + " > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 &").toLatin1()); } int qemu::Stop(){ system("killall qemu-system-x86_64 -9");