diff --git a/StartVM.sh b/StartVM.sh index 035a4f3..fa52bc7 100755 --- a/StartVM.sh +++ b/StartVM.sh @@ -10,7 +10,7 @@ VBoxManage showvminfo Windows if [[ 0 == $? ]]; then # 检测到虚拟机存在,启动虚拟机 - VBoxManage startvm Windows + VBoxManage startvm Windows > /tmp/windows-virtual-machine-installer-for-wine-runner-run.log 2>&1 exit fi # 检查是否有 QEMU @@ -45,11 +45,11 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then use=$(echo "scale=4; $MemTotal / 3" | bc) if [[ `arch` == "x86_64" ]]; then echo X86 架构,使用 kvm 加速 - 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 + 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 非 X86 架构,不使用 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 + 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 zenity --question --no-wrap --text="检查到您未创建所指定的虚拟机,是否创建虚拟机并继续?\n如果不创建将无法使用" diff --git a/VM-source/VirtualMachine.pro.user b/VM-source/VirtualMachine.pro.user index 729529d..711dcc6 100644 --- a/VM-source/VirtualMachine.pro.user +++ b/VM-source/VirtualMachine.pro.user @@ -1,6 +1,6 @@ - + EnvironmentId @@ -179,8 +179,8 @@ 0 0 - /home/gfdgd_xi/Desktop/deep-wine-runner/build-VirtualMachine-unknown-Debug - /home/gfdgd_xi/Desktop/deep-wine-runner/build-VirtualMachine-unknown-Debug + /home/gfdgd_xi/Desktop/build-VirtualMachine-unknown-Debug + /home/gfdgd_xi/Desktop/build-VirtualMachine-unknown-Debug true @@ -327,7 +327,7 @@ true false true - /home/gfdgd_xi/Desktop/deep-wine-runner/build-VirtualMachine-unknown-Debug + /home/gfdgd_xi/Desktop/build-VirtualMachine-unknown-Debug 1 diff --git a/VM-source/mainwindow.cpp b/VM-source/mainwindow.cpp index 92f98d8..cbfa737 100755 --- a/VM-source/mainwindow.cpp +++ b/VM-source/mainwindow.cpp @@ -344,7 +344,20 @@ void MainWindow::on_actionVMLog_triggered() return; } file.open(QIODevice::ReadOnly); - QInputDialog::getMultiLineText(this, "日志", "虚拟机日志",file.readAll()); + QInputDialog::getMultiLineText(this, "安装日志", "虚拟机安装日志",file.readAll()); + file.close(); +} + + +void MainWindow::on_actionVMRunlLog_triggered() +{ + QFile file("/tmp/windows-virtual-machine-installer-for-wine-runner-run.log"); + if(!file.exists()){ + QMessageBox::information(this, "提示", "没有日志文件"); + return; + } + file.open(QIODevice::ReadOnly); + QInputDialog::getMultiLineText(this, "运行日志", "虚拟机运行日志",file.readAll()); file.close(); } diff --git a/VM-source/mainwindow.h b/VM-source/mainwindow.h index 2c655cb..7198e90 100755 --- a/VM-source/mainwindow.h +++ b/VM-source/mainwindow.h @@ -48,6 +48,8 @@ private slots: void on_actionVMLog_triggered(); + void on_actionVMRunlLog_triggered(); + private: bool stopShowTime = 0; Ui::MainWindow *ui; diff --git a/VM-source/mainwindow.ui b/VM-source/mainwindow.ui index 5afd79d..bf92d85 100755 --- a/VM-source/mainwindow.ui +++ b/VM-source/mainwindow.ui @@ -452,7 +452,8 @@ p, li { white-space: pre-wrap; } 虚拟机 - + + @@ -476,9 +477,14 @@ p, li { white-space: pre-wrap; } 导出 - + - 虚拟机日志 + 虚拟机安装日志 + + + + + 虚拟机运行日志