大体功能完成

This commit is contained in:
2023-02-19 14:51:29 +08:00
parent 466958170f
commit 3d49e8dd7b
14 changed files with 602 additions and 20 deletions

View File

@@ -1,7 +1,11 @@
#include "buildvbox.h"
#include "vbox.h"
#include <QFile>
#include <QDir>
#include <QNetworkInterface>
#include <QMessageBox>
#include <QCoreApplication>
#include <infoutils.h>
using namespace std;
// 清屏
@@ -32,9 +36,42 @@ QString buildvbox::GetNet(){
return "";
}
buildvbox::buildvbox()
buildvbox::buildvbox(int id)
{
QString programPath = QCoreApplication::applicationDirPath();
QString net = GetNet();
qDebug() << "使用网卡:" << net << endl;
//vbox *box = new vbox("Window");
vbox vm("Windows");
switch (id) {
case 0:
vm.Create("Windows7");
vm.MountISO(programPath + "/Windows7X86Auto.iso", "storage_controller_1", 1);
break;
case 1:
vm.Create("Windows7_64");
vm.MountISO(programPath + "/Windows7X64Auto.iso", "storage_controller_1", 1);
break;
vm.Create("WindowsNT_64");
}
vm.SetCPU(1);
long memory = 0;
long memoryAll = 0;
long swap = 0;
long swapAll = 0;
infoUtils::memoryRate(memory, memoryAll, swap, swapAll);
//memoryRate(memory, memoryAll, swap, swapAll);
vm.SetMemory(memoryAll / 1024 / 1024 / 3);
vm.SetDisplayMemory(32);
vm.SetNetBridge(net);
vm.EnabledAudio();
vm.EnabledClipboardMode();
vm.EnabledDraganddrop();
vm.SetVBoxSVGA();
vm.SetMousePS2();
vm.SetKeyboardPS2();
vm.OpenUSB();
vm.ShareFile("ROOT", "/");
vm.ShareFile("HOME", QDir::homePath());
vm.Start();
}