VBoxManage: change nictype, etc. while VM running

This is for discussing general topics about how to use VirtualBox.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: VBoxManage: change nictype, etc. while VM running

Post by Perryg »

I looked at the code some today and the VBoxManageControlVM.cpp that should control this is very limited in what it actually does. While it lists nicproperty it does not validate anything, meaning you can state nicproperty1 foo="bar" and it allows the command even though it does nothing. It does actually validate against nicproperty*, where if you have only n-1 adapter enabled and try to change n-2 it fails because NIC2 is turned off, so it must be the arguments that are not validated, valid, or simply does not exist.

I find where they are doing this in the UI code but have not found out yet how they are actually passing the command. Since the only resource we have to change hot settings is using VBoxManage controlvm, I can only assume that this was missed.

At first I thought that since it was a property that would be actually used in memory and not stored there would *not* be an actual change in the stored properties, but now I am not even sure about that.

Anyway have a look at the source and you can see what I am talking about.
/trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp

I will keep looking but the code is very complex, which means it would be faster if one of the DEVs had an answer.

Note: Since the command was accepted I assumed (in error) that it was working. I should have fired up wireshark to test this further, so my bad.
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: VBoxManage: change nictype, etc. while VM running

Post by noteirak »

In your defense Perryg, the behaviour of Vboxmanage on this one is totally missleading, with absolutely no feedback - whereas the feedback is quite verbose about everywhere else.
I'll check the source code later during the day, see what I can make of it
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
srondeau
Posts: 10
Joined: 4. Mar 2010, 22:42
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: Windows

Re: VBoxManage: change nictype, etc. while VM running

Post by srondeau »

Perryg wrote:I looked at the code some today [...snip]
So had I, trying to make some sense of this, and got about as far as you did.
Note: Since the command was accepted I assumed (in error) that it was working. I should have fired up wireshark to test this further, so my bad.
No problem. You gave me hope that there was a solution, and it was enlightening to find out what did and didn't work with wireshark on and changing the promiscuity (at least, via the GUI).

I opened a ticket on this problem: [https://www.virtualbox.org/ticket/11423
Souliouz
Posts: 2
Joined: 10. Mar 2014, 00:29

Re: VBoxManage: change nictype, etc. while VM running

Post by Souliouz »

This is working to change the promiscuous mode

Code: Select all

>VBoxManage modifyvm VM1 --nicpromisc5 allow-all
Post Reply