mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-01-13 01:58:27 +08:00
修复QEMU安装XP无网络的问题
This commit is contained in:
parent
0d3e798644
commit
5443654791
@ -29,11 +29,11 @@ if [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then
|
|||||||
use=$(echo "scale=4; $MemTotal / 3" | bc)
|
use=$(echo "scale=4; $MemTotal / 3" | bc)
|
||||||
if [[ `arch` == "x86_64" ]]; then
|
if [[ `arch` == "x86_64" ]]; then
|
||||||
echo X86 架构,使用 kvm 加速
|
echo X86 架构,使用 kvm 加速
|
||||||
kvm --hda "$HOME/Qemu/Windows/Windows.qcow2" -soundhw all -smp $CpuCount -m ${use}G -net user,hostfwd=tcp::3389-:3389 -display vnc=:5 -display gtk -usb
|
kvm --hda "$HOME/Qemu/Windows/Windows.qcow2" -soundhw all -smp $CpuCount -m ${use}G -net user,hostfwd=tcp::3389-:3389 -display vnc=:5 -display gtk -usb -nic model=rtl8139
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
echo 非 X86 架构,不使用 kvm 加速
|
echo 非 X86 架构,不使用 kvm 加速
|
||||||
qemu-system-x86_64 --hda "$HOME/Qemu/Windows/Windows.qcow2" -soundhw all -smp $CpuCount -m ${use}G -net user,hostfwd=tcp::3389-:3389 -display vnc=:5 -display gtk -usb
|
qemu-system-x86_64 --hda "$HOME/Qemu/Windows/Windows.qcow2" -soundhw all -smp $CpuCount -m ${use}G -net user,hostfwd=tcp::3389-:3389 -display vnc=:5 -display gtk -usb -nic model=rtl8139
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
zenity --question --no-wrap --text="检查到您未创建所指定的虚拟机,是否创建虚拟机并继续?\n如果不创建将无法使用"
|
zenity --question --no-wrap --text="检查到您未创建所指定的虚拟机,是否创建虚拟机并继续?\n如果不创建将无法使用"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE QtCreatorProject>
|
<!DOCTYPE QtCreatorProject>
|
||||||
<!-- Written by QtCreator 4.8.2, 2023-04-22T21:23:25. -->
|
<!-- Written by QtCreator 4.8.2, 2023-04-28T23:27:18. -->
|
||||||
<qtcreator>
|
<qtcreator>
|
||||||
<data>
|
<data>
|
||||||
<variable>EnvironmentId</variable>
|
<variable>EnvironmentId</variable>
|
||||||
|
@ -72,7 +72,7 @@ int qemu::Start(bool unShown){
|
|||||||
if(Command().GetCommand("arch").replace("\n", "").replace(" ", "") == "x86_64"){
|
if(Command().GetCommand("arch").replace("\n", "").replace(" ", "") == "x86_64"){
|
||||||
return system(("kvm " + commandOption + " &").toLatin1());
|
return system(("kvm " + commandOption + " &").toLatin1());
|
||||||
}
|
}
|
||||||
return system(("qemu-system-x86_64 " + commandOption + " &").toLatin1());
|
return system(("qemu-system-x86_64 -nic model=rtl8139 " + commandOption + " &").toLatin1());
|
||||||
}
|
}
|
||||||
int qemu::Stop(){
|
int qemu::Stop(){
|
||||||
system("killall qemu-system-x86_64 -9");
|
system("killall qemu-system-x86_64 -9");
|
||||||
|
@ -21,7 +21,7 @@ except:
|
|||||||
print("无法读取配置")
|
print("无法读取配置")
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
option = f"--hda \"$HOME/Qemu/Windows/Windows.qcow2\" -usb -m {setting['Memory']}M -smp {setting['CPU']} "
|
option = f"-nic model=rtl8139 --hda \"$HOME/Qemu/Windows/Windows.qcow2\" -usb -m {setting['Memory']}M -smp {setting['CPU']} "
|
||||||
if setting["EnableKVM"]:
|
if setting["EnableKVM"]:
|
||||||
command = "kvm"
|
command = "kvm"
|
||||||
if setting["EnableRDP"]:
|
if setting["EnableRDP"]:
|
||||||
|
Loading…
Reference in New Issue
Block a user