Exported Virtual Box VM (CentOS 5.5 with Guest Additions Installed) - Success
Imported CentOS VM Successfully on another Windows Machine via Windows Batch

Problem :
VM After Import retains the same Mac Address and gets the same IP as it was exported from, is there a way one can either change / flush the IP & MAC while exporting or after Importing ?

a VBoxManage command may be? Which I can put in a batch file after import ?

Will be grateful for your assistance on this Kind Regards

2 Answers 2


You can change the macaddress of a machine with

vboxmanage modifyvm VMName --macaddressN macaddress

where N is the interface number and macaddress matches the regexp [0-9A-Fa-f][02468ACEace][0-9A-Fa-f]{10}


vboxmanage modifyvm VMName --macaddress1 000027D15bE8

Did you set a static IP address on your base VM ?


Based on the discussion below I think you will be better off using

vboxmanage modifyvm VMName --macaddressN auto

Which will set a new mac address once. The machine will then retain that new mac address.

  • Hi Iain, Thank you so much for your prompt response like always !! No, I didn't set a Static IP So in your example, I would basically first copy the existing mac address of the VM and then use the command : vboxmanage modifyvm CENTOS --macaddress0 <stuck with regexp> Do I just use the regular expression you have used as an e.g. above or do I need to generate a new regexp ? no knowledge of regexp :-) Thanks again !!!!
    – Mutahir
    Oct 27, 2010 at 13:28
  • The regexp basically means that you can have any mac address that you like however the 2nd number has to be one of 02468ACEace. I don't know why this restriction has been put in place. so 000027D15bE8 would be valid whereas 010027D15bE8
    – user9517
    Oct 27, 2010 at 13:37
  • Hi Iain, so I will batch the following command up after the import which will modify the mac address : vboxmanage modifyvm CentOS --macaddress0 [0-9A-Fa-f][02468ACEace][0-9A-Fa-f]{10} and this command will basically force the vm to get a new mac address via the regular expression ? Sorry for being dumb - no good in reg exp or programming :-)
    – Mutahir
    Oct 27, 2010 at 13:48
  • No - you would have to have the batch file generate mac addresses. I've edited my original response with some new information.
    – user9517
    Oct 27, 2010 at 14:15
  • As the Wikipedia article shows, the least two significant bits in the first byte designate whether the address is universal or local (i.e. "official" or "something you made up") and unicast or multicast, respectively. This answer provides a little more detail: serverfault.com/questions/40712/… Oct 27, 2010 at 15:36

Here is a simple sample script that I created. It may be useful as an example of what you can do.

A little side not there are only 8 network interfaces available for configuration


# this script changes the network set up $cable a virtual box vim

#vboxmanage showvminfo "floating" | grep NIC
# usefull to see your vms configuration

echo "network interface $nic"
vboxmanage modifyvm $vmname --nic$nic bridged --nictype$nic "82540EM" --cableconnected$nic $cable --bridgeadapter$nic $hostinterface --macaddress$nic 08002713F6EA

echo "network interface $nic"
vboxmanage modifyvm $vmname --nic$nic bridged --nictype$nic "82540EM" --cableconnected$nic $cable --bridgeadapter$nic $hostinterface --macaddress$nic 08002713F6EB

vboxmanage showvminfo $vmname | grep NIC
#vboxmanage startvm "$vmname"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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