mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-01-12 17:48: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)
|
||||
if [[ `arch` == "x86_64" ]]; then
|
||||
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
|
||||
fi
|
||||
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
|
||||
fi
|
||||
zenity --question --no-wrap --text="检查到您未创建所指定的虚拟机,是否创建虚拟机并继续?\n如果不创建将无法使用"
|
||||
@ -42,4 +42,4 @@ if [[ 1 == $? ]]; then
|
||||
exit
|
||||
fi
|
||||
cd `dirname $0`
|
||||
./VM/VirtualMachine
|
||||
./VM/VirtualMachine
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!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>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
|
@ -72,7 +72,7 @@ int qemu::Start(bool unShown){
|
||||
if(Command().GetCommand("arch").replace("\n", "").replace(" ", "") == "x86_64"){
|
||||
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(){
|
||||
system("killall qemu-system-x86_64 -9");
|
||||
|
@ -21,7 +21,7 @@ except:
|
||||
print("无法读取配置")
|
||||
traceback.print_exc()
|
||||
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"]:
|
||||
command = "kvm"
|
||||
if setting["EnableRDP"]:
|
||||
@ -30,4 +30,4 @@ if setting["EnableVNC"]:
|
||||
option += f"-display gtk -display vnc=:{setting['VNC']} "
|
||||
if setting["EnableSound"]:
|
||||
option += "-soundhw all "
|
||||
os.system(f"{command} {option}")
|
||||
os.system(f"{command} {option}")
|
||||
|
Loading…
Reference in New Issue
Block a user