VirtualBox

Opened 5 years ago

Closed 3 years ago

#18523 closed defect (invalid)

"VBoxManage controlvm VM setlinkstate1 on/off" - not working properly like GUI mode

Reported by: maucarioca Owned by:
Component: network Version: VirtualBox 5.2.12
Keywords: setlinkstate1, controlvm, bridged, ip, cable connected Cc:
Guest type: Linux Host type: Windows

Description

My VM is started with a default NAT Networking with an IP like 10.2.XX.XX. Inside the Vagrant File I call the command "VBOXManage controlvm VM nic1 bridged eth0" to change my network type to bridge. After this I call in sequence the commands: "VBoxManage controlvm VM setlinkstate1 off" and "VBoxManage controlvm VM setlinkstate1 on" to change my network type. I saw in GUI that these commands properly uncheck the "Cable Connected" checkbox and check after but do not change the IP properly (refresh). When I do these same steps through GUI(open menu Devices > Network > Network Settings > Advanced, unckeck Cable Connected and click OK / open menu Devices > Network > Network Settings > Advanced, check Cable Connected and click OK) the VistualBox refreshs IP as expected.

Attachments (6)

Capturar1.JPG (78.9 KB ) - added by maucarioca 5 years ago.
Bridge Config
Capturar2.JPG (113.0 KB ) - added by maucarioca 5 years ago.
Bridge with NAT IP
Capturar3.JPG (25.1 KB ) - added by maucarioca 5 years ago.
After first reply
Capturar3.2.JPG (25.1 KB ) - added by maucarioca 5 years ago.
After first reply
Capturar4.JPG (23.7 KB ) - added by maucarioca 5 years ago.
After first reply
VM_TESTE-2019-03-29-11-13-27.log (138.6 KB ) - added by maucarioca 5 years ago.
VM´s log

Download all attachments as: .zip

Change History (14)

by maucarioca, 5 years ago

Attachment: Capturar1.JPG added

Bridge Config

by maucarioca, 5 years ago

Attachment: Capturar2.JPG added

Bridge with NAT IP

comment:1 by maucarioca, 5 years ago

Where you read: and "VBoxManage controlvm VM setlinkstate1 on" to change my network type it´s: and "VBoxManage controlvm VM setlinkstate1 on" to refresh my network info

comment:2 by janitor, 5 years ago

Have you tried adding a delay between these two commands, say 5 seconds? You probably can't click that fast, so the delay is natural in GUI case. Guest would usually ignore short transient connectivity loss and will not do DHCP refresh.

in reply to:  2 comment:3 by maucarioca, 5 years ago

Replying to janitor:

Have you tried adding a delay between these two commands, say 5 seconds? You probably can't click that fast, so the delay is natural in GUI case. Guest would usually ignore short transient connectivity loss and will not do DHCP refresh.

Thanks for return. Answering the question: Yes. I tried again after your reply to check the information. I did manually calling command from a "cmd" respecting the properly delay (more than a minute between steps). Any ideas?

by maucarioca, 5 years ago

Attachment: Capturar3.JPG added

After first reply

by maucarioca, 5 years ago

Attachment: Capturar3.2.JPG added

After first reply

by maucarioca, 5 years ago

Attachment: Capturar4.JPG added

After first reply

comment:4 by Socratis, 5 years ago

We need to see a complete VBox.log, from a complete VM run, when the problem occurs:

  • Start the VM from cold-boot (not from a paused or saved state) / Create-Observe problem / Shutdown the VM (force close it if you have to).
  • With the VM completely shut down (not paused or saved), right-click on the VM in the VirtualBox Manager and select "Show Log".
  • Save only the first "VBox.log" and attach it to your response.

Oh, BTW, please don't attempt to obfuscate anything, or I'm going to obfuscate my reply. Can't solve a problem with hidden or half-baked information. These are virtual MACs and UUIDs...

by maucarioca, 5 years ago

VM´s log

in reply to:  4 comment:5 by maucarioca, 5 years ago

Replying to socratis:

We need to see a complete VBox.log, from a complete VM run, when the problem occurs:

  • Start the VM from cold-boot (not from a paused or saved state) / Create-Observe problem / Shutdown the VM (force close it if you have to).
  • With the VM completely shut down (not paused or saved), right-click on the VM in the VirtualBox Manager and select "Show Log".
  • Save only the first "VBox.log" and attach it to your response.

Oh, BTW, please don't attempt to obfuscate anything, or I'm going to obfuscate my reply. Can't solve a problem with hidden or half-baked information. These are virtual MACs and UUIDs...

Please see the log in attachments.

comment:6 by maucarioca, 5 years ago

Any news? Do you need more information?

comment:7 by Socratis, 5 years ago

  1. VirtualBox VM 5.2.12 r122591 win.amd64 (May  9 2018 10:42:46) release log 
    
    That's a rather old VirtualBox version that you have there. You need to update to the latest and greatest, either 5.2.26 or 6.0.4 as of this writing.
  1. 00:00:02.927690 NumCPUs <integer> = 0x0000000000000002 (2)
    00:00:03.744696 CPUM: Physical host cores: 2
    
    You have assigned all your CPUs to the VM. The host is going to run low on resources, since VirtualBox cares about physical processors (cores), not logical ones (threads).
  1. 00:00:02.927616   VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant="1" 
    
    Why is Vagrant mentioned here? Are you using Vagrant to deploy your VM? Vagrant is a program that relies on VirtualBox, but modifies its configuration files in unknown ways to us, and with unknown consequences, especially the networking part. They have their own Vagrant support channels.

comment:8 by janitor, 3 years ago

Resolution: invalid
Status: newclosed

You are trying to configure the VM to bridge to eth0. There's no such interface on your Windows host. Unfortunately this is not reported to the controlvm command, but it is noted in the log file:

Nonexistent host networking interface, name 'eth0'
Note: See TracTickets for help on using tickets.

© 2023 Oracle
ContactPrivacy policyTerms of Use