3

Is there any chance to get an unique host system ID within my VM that is hosted in VirtualBox?

Asked different: is there an unique ID of the host system that I can read from the virtual machine. In case I import the same VM into another host system, can the VM detect that it runs in another host system?

Wesley
  • 32,840
PeterMmm
  • 905

2 Answers2

5

With KVM/libvirt you can run dmidecode -t system on the host VM, it exports the UUID generated in libvirt from the XML description. It should be unique to each VM.

Matthew Ife
  • 23,567
2

Each .vdi file has a UUID that can be seen by using the vboxmanage command. For example vboxmanage showhdinfo \path\to\file.vdi

From within the guest you'll need to read MIfe's answer! =) first user vboxmanage from the host to set a GuestProperty starting like this: vboxmanage guestproperty set and name it UUID. Then from within the guest you'll retrieve it with vboxcontrol, something like this: vboxcontrol guestproperty get /VirtualBox/GuestProperty/whateverYouNamedTheProperty

Wesley
  • 32,840