Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

closed as off-topic by Falcon Momot, mdpc, Dennis Kaarsemaker, Ward, Journeyman Geek Jan 16 at 9:16

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must be relevant to professional system administration. Server Fault is dedicated to professional system and network administrators. End user and enthusiast questions are off-topic (contact your system administrator or hire a professional to help you out). Please see the Help Center for more information." – Falcon Momot, mdpc, Journeyman Geek
If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers

up vote 4 down vote accepted

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.

share|improve this answer
    
The question was tagged virtualbox. I edited the question to make it clearer. –  Wesley Dec 12 '13 at 16:17
    
From my googling there appears to be good indication that the same values can also exported in virtualbox. –  Matthew Ife Dec 12 '13 at 16:24
    
I get UUID: EAF44EA1-F755-4E9C-B506-400..., seems to be good –  PeterMmm Dec 12 '13 at 16:28
    
@MIfe oooOOOOoo, spifftastic. –  Wesley Dec 12 '13 at 16:32
    
@PeterMmm But isn't this only on the host system and not from within the guest? –  Wesley Dec 12 '13 at 16:32
show 1 more comment

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

share|improve this answer
    
Running vboxmanage on host system. But I'm interested in getting an ID from within the VM ... –  PeterMmm Dec 12 '13 at 16:24
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.