clonevm in link option doesn't respect the original network settings

This is for discussing general topics about how to use VirtualBox.
Post Reply
Neymar
Posts: 1
Joined: 17. Sep 2018, 00:17

clonevm in link option doesn't respect the original network settings

Post by Neymar »

When I clone a VM with:

~$ vboxmanage clonevm "Ubuntu" --snapshot "Snapshot 1" --options link --name "Ubuntu Clone" --register

The new network settings of Ubuntu Clone vm appears as "attached to NAT" (the default), while in the original snaptshot are set as "bridged".
So, to correct this, I tried right after to insert the following line in my script:


~$ VBoxManage modifyvm "Ubuntu Clone" --nic1 bridged --nictype1 82540EM --cableconnected1 off --nicpromisc1 deny --bridgeadapter1 wlp2s0


and I also tried without the --nictype1 82540EM, because this option is not actually available in GUI interface when in saved state. In both cases I got the error:


VBoxManage: error: The machine is not mutable (state is Saved)
VBoxManage: error: Details: code VBOX_E_INVALID_VM_STATE (0x80bb0002), component SessionMachine, interface IMachine, callee nsISupports
VBoxManage: error: Context: "COMSETTER(Enabled)(TRUE)" at line 1562 of file VBoxManageModifyVM.cpp


Well, these settings are in fact mutable in the saved state, the problem is that modifyvm seems not to know this (Am I wrong?). And clonevm doesn't respect the original network settings.

Is it possible to work around this issue? I just want to make a elementary script on ubuntu to automate some of my tasks in virtualbox.

Thanx
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: clonevm in link option doesn't respect the original network settings

Post by socratis »

Moving to "Using VirtualBox" from "VirtualBox API". This is not an API question...

What happens if you do the cloning from the GUI, the VirtualBox Manager?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply