VBox Commands

Allgemeine Informationen zu VirtualBox

Beschreibung
VBoxManage list vms Listet alle VMs auf.
VBoxManage list runningvms Listet alle laufenden VMs auf.
VBoxManage list bridgedifs Listet alle Bridge-Netzwerkadapter auf.
VBoxManage list hostonlyifs Listet alle Host-Only-Netzwerkadapter auf.
VBoxManage list natnets Listet alle NAT-Netzwerke auf.
VBoxManage list dhcpservers Listet alle DHCP-Server auf.
VBoxManage list extpacks Listet alle installierten Extension Packs auf.

Grundlagen zu VMs

Befehl Beschreibung
VBoxManage startvm VMName –type headless Startet die VM im Headless-Modus.
VBoxManage controlvm VMName poweroff Schaltet die VM sofort aus.
VBoxManage controlvm VMName acpipowerbutton Simuliert das Drücken des Power-Buttons der VM.
VBoxManage controlvm VMName reset Setzt die VM sofort zurück.
VBoxManage controlvm VMName pause Pausiert die VM.
VBoxManage controlvm VMName resume Setzt die pausierte VM fort.

Snapshots

Befehl Beschreibung
VBoxManage snapshot VMName take SnapshotName –description Snapshot Description Erstellt einen Snapshot der VM.
VBoxManage snapshot VMName restore SnapshotName Stellt die VM von einem Snapshot wieder her.
VBoxManage snapshot VMName delete SnapshotName Löscht einen Snapshot.

Modifikationen

Befehl Beschreibung
VBoxManage modifyvm VMName –memory 2048 Setzt den Arbeitsspeicher der VM auf 2048 MB.
VBoxManage modifyvm VMName –cpus 2 Setzt die Anzahl der CPUs der VM auf 2.
VBoxManage modifyvm VMName –vrde on Aktiviert den VRDP-Server für die VM.
VBoxManage modifyvm VMName –nic1 nat Setzt den Netzwerkadapter 1 auf NAT.
VBoxManage modifyvm VMName –nic1 bridged –bridgeadapter1 eth0 Setzt den Netzwerkadapter 1 auf Bridged und wählt „eth0“ als Adapter.
VBoxManage modifyvm VMName –hostonlyadapter1 vboxnet0 Setzt den Netzwerkadapter 1 auf Host-Only und wählt „vboxnet0“ als Adapter.
VBoxManage modifyvm VMName –macaddress1 080027123456 Setzt die MAC-Adresse des Netzwerkadapters 1.
VBoxManage modifyvm VMName –boot1 dvd –boot2 disk –boot3 none –boot4 none Setzt die Boot-Reihenfolge der VM.
VBoxManage modifyvm VMName –ioapic on Aktiviert IO APIC für die VM.
VBoxManage modifyvm VMName –pae on Aktiviert PAE/NX für die VM.
VBoxManage modifyvm VMName –nestedpaging on Aktiviert Nested Paging für die VM.
VBoxManage modifyvm VMName –largepages on Aktiviert Large Pages für die VM.
VBoxManage modifyvm VMName –clipboard bidirectional Setzt die Zwischenablage der VM auf bidirektional.
VBoxManage modifyvm VMName –draganddrop bidirectional Setzt Drag-and-Drop der VM auf bidirektional.
VBoxManage modifyvm VMName –vrdeport 5000 Setzt den VRDE-Port der VM auf 5000.

Gast-Kontrolle

Befehl Beschreibung
VBoxManage.exe guestcontrol Schlinux run –exe „/bin/bash“ –username „username“ –password „passwd“ — -c „programm Ausführen von Programmen.
VBoxManage.exe guestcontrol „Schlinux“ run –exe „/bin/bash“ –username „username“ –password „passwd“ — -c „echo ‚passwd‚ | sudo -S apt-get install programm -y“ Installation von Programmen mit sudo.
VBoxManage guestcontrol VMName copyto –username username –password passwd „C:\localfile“ „/home/user/remote Kopiert eine Datei von Host zu VM.
VBoxManage guestcontrol VMName copyfrom –username username –password passwd „/home/user/remote“ „C:\localfile Kopiert eine Datei von VM zu Host.
VBoxManage guestcontrol VMName mkdir –username username –password passwd „/home/user/newdir Erstellt ein Verzeichnis in der VM.
VBoxManage guestcontrol VMName remove –username username –password passwd „/home/user/file Entfernt eine Datei in der VM.
VBoxManage guestcontrol VMName chmod –username username –password passwd 755 „/home/user/file Ändert Dateiberechtigungen in der VM.
VBoxManage guestcontrol VMName chown –username username –password passwd „user:group“ „/home/user/file Ändert Dateibesitz in der VM.
VBoxManage guestcontrol VMName reboot –username username –password passwd Startet die VM neu.
VBoxManage guestcontrol VMName shutdown –username username –password passwd Fährt die VM herunter.
VBoxManage guestcontrol VMName updateadditions Aktualisiert die Guest Additions in der VM.

Sonstige Interaktionen

Befehl Beschreibung
VBoxManage createmedium disk –filename „DiskPath.vdi“ –size 10240 Erstellt eine neue virtuelle Festplatte mit 10 GB.
VBoxManage closemedium disk „DiskPath.vdi Schließt eine virtuelle Festplatte.
VBoxManage storagectl „VMName“ –name „SATA Controller“ –add sata –controller IntelAHCI Fügt einen SATA-Controller zur VM hinzu.
VBoxManage storageattach VMName –storagectl „SATA Controller“ –port 0 –device 0 –type hdd –medium „DiskPath.vdi“ Hängt eine virtuelle Festplatte an die VM.
VBoxManage storageattach VMName –storagectl „IDE Controller“ –port 1 –device 0 –type dvddrive –medium „emptydrive Hängt ein leeres DVD-Laufwerk an die VM an.
VBoxManage setextradata VMName „VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVersion“ „1234 Setzt eine benutzerdefinierte BIOS-Version für die VM.
VBoxManage showvminfo VMName Zeigt Informationen über die VM an.
VBoxManage unattended install VMName –user=username –password=passwd –full-user-name=“User“ –install-additions –iso=“path/to/iso Führt eine unbeaufsichtigte Installation durch.
VBoxManage controlvm VMName screenshotpng „screenshot.png Macht einen Screenshot der VM und speichert ihn als PNG-Datei.
VBoxManage debugvm VMName dumpvmcore –filename „path/to/memory.dmp Erstellt einen Dump des Arbeitsspeichers.
Schreibe einen Kommentar 0