Bereinigung

This commit is contained in:
2023-11-09 13:08:06 +01:00
parent 9365fb3b30
commit 2da8033c11
9 changed files with 15 additions and 262 deletions

24
dev/vbox_api.py Normal file
View File

@@ -0,0 +1,24 @@
from pyvbox import VirtualBox
# Verbindung zur VirtualBox-Instanz herstellen
vbox = VirtualBox()
# Erstellen Sie eine neue virtuelle Maschine
vm = vbox.create_machine("MyVM", "Linux", "Ubuntu_64", [])
# Konfigurieren Sie die virtuelle Maschine
vm.memory_size = 1024 # 1 GB RAM
vm.os_type_id = "Ubuntu_64"
# Erstellen Sie einen neuen Festplattencontroller und eine Festplatte
controller = vm.add_storage_controller("SATA")
vm.attach_device(controller, 0, 0, "hdd", "None", "MyDisk.vdi")
# Erstellen Sie eine Netzwerkkarte
network_adapter = vm.get_network_adapter(0)
network_adapter.attachment_type = "Bridged"
# Speichern Sie die virtuelle Maschine
vbox.register_machine(vm)
print("Virtuelle Maschine erstellt: {}".format(vm.name))