diff --git a/VM-source/VirtualMachine b/VM-source/VirtualMachine index 5a609b7..9743245 100755 Binary files a/VM-source/VirtualMachine and b/VM-source/VirtualMachine differ diff --git a/VM-source/vbox.cpp b/VM-source/vbox.cpp index 14872c6..31e0f48 100644 --- a/VM-source/vbox.cpp +++ b/VM-source/vbox.cpp @@ -30,59 +30,66 @@ int vbox::MountISO(QString isoPath, QString controlName, int port, int device){ + " --medium \"{isoPath}\"").toUtf8()); } int vbox::BootFirst(QString bootDrive){ - //return os.system(f"\"{self.managerPath}\" modifyvm \"{self.name}\" --boot1 {bootDrive}") + return system(("\"" + managerPath + "\" modifyvm \"" + name + "\" --boot1 " + bootDrive).toUtf8()); } int vbox::SetNetBridge(QString netDriver){ - + return system(("\"" + managerPath + "\" modifyvm \"" + name + + "\" --nic1 bridged --cableconnected1 on --nictype1 82540EM --bridgeadapter1 \"" + netDriver + "\" --intnet1 brigh1 --macaddress1 auto").toUtf8()); } int vbox::SetCPU(int number){ - + return system(("\"" + managerPath + "\" modifyvm \"" + name + "\" --cpus " + number).toUtf8()); } int vbox::SetMemory(int memory){ - + return system(("\"" + managerPath + "\" modifyvm \"" + name + "\" --memory " + memory).toUtf8()); } int vbox::SetRemote(bool setting){ - + if(setting){ + return system(("\"" + managerPath + "\" modifyvm \"" + name + "\" --vrde on").toUtf8()); + } + return system(("\"" + managerPath + "\" modifyvm \"" + name + "\" --vrde off").toUtf8()); } int vbox::SetRemoteConnectSetting(int port){ - + return system(("\"" + managerPath + "\" modifyvm \"" + name + "\" --vrdeport " + port + " --vrdeaddress """).toUtf8()); } -void vbox::Start(bool unShown){ - +int vbox::Start(bool unShown){ + if(unShown){ + return system(("\"" + managerPath + "\"").toUtf8()); + } + return system(("\"" + managerPath + "\" startvm \"" + name + "\"").toUtf8()); } int vbox::Stop(){ - + return system(("\"" + managerPath + "\" controlvm \"" + name + "\" poweroff").toUtf8()); } int vbox::Delete(){ - + return system(("\"" + managerPath + "\" unregistervm --delete \"" + name + "\"").toUtf8()); } int vbox::SetDisplayMemory(int memory){ - + return system(("\"" + managerPath + "\" modifyvm \"" + name + "\" --vram " + memory).toUtf8()); } int vbox::InstallGuessAdditions(QString controlName, int port, int device){ - + return MountISO("/usr/share/virtualbox/VBoxGuestAdditions.iso", controlName, port, device); } int vbox::EnabledAudio(){ - + return system(("\"" + managerPath + "\" modifyvm \"" + name + "\" --audio pulse --audiocontroller hda --audioin on --audioout on").toUtf8()); } int vbox::EnabledClipboardMode(){ - + return system(("\"" + managerPath + "\" modifyvm \"" + name + "\" --clipboard-mode bidirectional").toUtf8()); } int vbox::EnabledDraganddrop(){ - + return system(("\"" + managerPath + "\" modifyvm \"" + name + "\" --draganddrop bidirectional").toUtf8()); } int vbox::ShareFile(QString name, QString path){ - + return system(("\"" + managerPath + "\" sharedfolder add \"" + this->name + "\" -name \"" + name + "\" -hostpath \"" + path + "\"").toUtf8()); } int vbox::SetVBoxSVGA(){ - + return system(("\"" + managerPath + "\" modifyvm \"" + name + "\" --graphicscontroller vboxsvga").toUtf8()); } int vbox::SetMousePS2(){ - + return system(("\"" + managerPath + "\" modifyvm \"" + name + "\" --mouse usb").toUtf8()); } int vbox::SetKeyboardPS2(){ - + return system(("\"" + managerPath + "\" modifyvm \"" + name + "\" --keyboard usb").toUtf8()); } int vbox::OpenUSB(){ - + return system(("\"" + managerPath + "\" modifyvm \"" + name + "\" --usbohci on").toUtf8()); } diff --git a/VM-source/vbox.h b/VM-source/vbox.h index 02a8768..64af5e2 100644 --- a/VM-source/vbox.h +++ b/VM-source/vbox.h @@ -21,7 +21,7 @@ public: int SetMemory(int memory); int SetRemote(bool setting); int SetRemoteConnectSetting(int port=5540); - void Start(bool unShown=false); + int Start(bool unShown=false); int Stop(); int Delete(); int SetDisplayMemory(int memory); diff --git a/VM-source/vbox.o b/VM-source/vbox.o index a8c83d1..4fe9e05 100644 Binary files a/VM-source/vbox.o and b/VM-source/vbox.o differ