VirtualBox

Opened 17 months ago

Last modified 17 months ago

#21889 new defect

Virtualbox 7: importing does not register VM correctly

Reported by: draget Owned by:
Component: VM control Version: VirtualBox-7.0.12
Keywords: Cc:
Guest type: Linux Host type: Linux

Description

I am trying to debug a vagrant issue that is plaguing a few people since version 7.

Somehow a VM gets created and started, actually running, but VirtualBox does not recognize it exists and claims a false state.

Ever since switching to Virtualbox 7.x, my vagrant setup does not longer work. It creates a VM that starts and runs, a directory is created under ~/.VirtualBox/Machines/xxx.

But the VirtualBox GUI does not show any new VM. Querying the state claims it is powered off, while it is running.

I traced the commands that are run:

VBoxManage import /home/draget/.vagrant.d/boxes/bento-VAGRANTSLASH-ubuntu-22.04/202212.11.0/virtualbox/box.ovf

Disks:

vmdisk1 68719476736 -1 http://www.vmware.com/interfaces/specifications/vmdk.html#streamOptimized ubuntu-22.04-amd64-disk001.vmdk -1 -1

Virtual system 0:

0: Suggested OS type: "Ubuntu_64"

(change with "--vsys 0 --ostype <type>"; use "list ostypes" to list all possible values)

1: Suggested VM name "ubuntu-22.04-amd64"

(change with "--vsys 0 --vmname <name>")

2: Suggested VM group "/"

(change with "--vsys 0 --group <group>")

3: Suggested VM settings file name "/home/draget/.VirtualBox/Machines/ubuntu-22.04-amd64/ubuntu-22.04-amd64.vbox"

(change with "--vsys 0 --settingsfile <filename>")

4: Suggested VM base folder "/home/draget/.VirtualBox/Machines"

(change with "--vsys 0 --basefolder <path>")

5: Number of CPUs: 2

(change with "--vsys 0 --cpus <n>")

6: Guest memory: 1024 MB

(change with "--vsys 0 --memory <MB>")

7: Network adapter: orig NAT, config 3, extra slot=0;type=NAT 8: IDE controller, type PIIX4

(disable with "--vsys 0 --unit 8 --ignore")

9: IDE controller, type PIIX4

(disable with "--vsys 0 --unit 9 --ignore")

10: SATA controller, type AHCI

(disable with "--vsys 0 --unit 10 --ignore")

11: Hard disk image: source image=ubuntu-22.04-amd64-disk001.vmdk, target path=ubuntu-22.04-amd64-disk001.vmdk, controller=10;port=0

(change target path with "--vsys 0 --unit 11 --disk path"; change controller with "--vsys 0 --unit 11 --controller <index>"; change controller port with "--vsys 0 --unit 11 --port <n>"; disable with "--vsys 0 --unit 11 --ignore")

Causes the VM to be in this strange limbo state. I can actually manually add it to the UI and can start it again. The VM runs two times them and destroys the disk image on writing.

Running on Gentoo, Kernel 6.1, KDE.

Change History (2)

comment:1 by draget, 17 months ago

Okay, checked again by going through the steps myself. Now it worked. Which really puzzled me. I extracted all the VBoxManage calls from vagrant:

locale -a
VBoxManage --version
VBoxManage list hostonlyifs
VBoxManage import -n /home/draget/.vagrant.d/boxes/bento-VAGRANTSLASH-ubuntu-22.04/202212.11.0/virtualbox/box.ovf
VBoxManage import /home/draget/.vagrant.d/boxes/bento-VAGRANTSLASH-ubuntu-22.04/202212.11.0/virtualbox/box.ovf --vsys 0 --vmname ubuntu-22.04-amd64_1698537895041_75353 --vsys 0 --unit 11 --disk /home/draget/.VirtualBox/Machines/ubuntu-22.04-amd64_1698537895041_75353/ubuntu-22.04-amd64-disk001.vmdk
VBoxManage list vms
VBoxManage showvminfo 3d901118-a9d3-49fb-9e10-7a23f852e151
VBoxManage showvminfo 3d901118-a9d3-49fb-9e10-7a23f852e151 --machinereadable
VBoxManage modifyvm 3d901118-a9d3-49fb-9e10-7a23f852e151 --macaddress1 080027DCEE4D
VBoxManage list hostonlyifs
 INFO subprocess: Starting process: ["/tmp/.mount_vagran2h1g5R/usr/bin/curl -q --fail --location --max-redirs 10 --verbose --user-agent Vagrant/2.4.0 (+https://www.vagrantup.com; ruby3.1.4) -H Accept: application/json --output /tmp/vagrant-load-metadata20231029-1576361-hvfsgf https://vagrantcloud.com/bento/ubuntu-22.04
VBoxManage showvminfo 3d901118-a9d3-49fb-9e10-7a23f852e151 --machinereadable
VBoxManage list systemproperties
VBoxManage list vms
VBoxManage modifyvm 3d901118-a9d3-49fb-9e10-7a23f852e151 --name linuxloung_streamingvm_default_1698537908026_87484
VBoxManage showvminfo 3d901118-a9d3-49fb-9e10-7a23f852e151 --machinereadable
VBoxManage list vms
VBoxManage showvminfo 3d901118-a9d3-49fb-9e10-7a23f852e151 --machinereadable
VBoxManage list vms
VBoxManage showvminfo 3d901118-a9d3-49fb-9e10-7a23f852e151 --machinereadable
VBoxManage guestproperty get 3d901118-a9d3-49fb-9e10-7a23f852e151 /VirtualBox/GuestInfo/OS/Product
VBoxManage setextradata 3d901118-a9d3-49fb-9e10-7a23f852e151 VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant 1
VBoxManage sharedfolder add 3d901118-a9d3-49fb-9e10-7a23f852e151 --name vagrant --hostpath /home/draget/coding/foss_contributions/linuxloung_streamingvm
VBoxManage modifyvm 3d901118-a9d3-49fb-9e10-7a23f852e151 --nic2 none --nic3 none --nic4 none --nic5 none --nic6 none --nic7 none --nic8 none
VBoxManage modifyvm 3d901118-a9d3-49fb-9e10-7a23f852e151 --nic1 nat
VBoxManage showvminfo 3d901118-a9d3-49fb-9e10-7a23f852e151 --machinereadable
VBoxManage modifyvm 3d901118-a9d3-49fb-9e10-7a23f852e151 --natpf1 ssh,tcp,127.0.0.1,2222,,22
VBoxManage modifyvm 3d901118-a9d3-49fb-9e10-7a23f852e151 --rtcuseutc on
VBoxManage modifyvm 3d901118-a9d3-49fb-9e10-7a23f852e151 --natdnsproxy1 on
VBoxManage modifyvm 3d901118-a9d3-49fb-9e10-7a23f852e151 --memory 2048
VBoxManage startvm 3d901118-a9d3-49fb-9e10-7a23f852e151 --type gui
VBoxManage showvminfo 3d901118-a9d3-49fb-9e10-7a23f852e151 --machinereadable

(Some repetitions removed)

And then went through them one by one. It worked.

Then I tried vagrant again, and it didn't. But what I noticed: The VirtualBox GUI was English, while my locale is German. I saw it before, but thought vagrant just wanted to make sure the commands would return English responses. But vagrant is am AppImage binary. I tries the older distribution package (Gentoo) and it worked.

I am really struggling to find out how vagrant distributed via AppImage is able to start a VM that shares the same VM locally on my '.VirtualBox/Machines' directory but somehow is not registered at all with VirutalBox. So much, that I can open the VM and start it running two times, causing two VMs trashing the same disk image (one VM-GUI English started by vagrant, one VM-GUI German started by me)

I do not know about any namespace-isolation methods of AppImage, so if it starts VBoxManage, it should not be able to bypass the existing settings and I should not be able to have a VM running that VirtualBox claims to be 'powered off'. So it is VBoxs fault? Or did vagrant mess up something when creating the AppImage, actively breaking the VBoxManage process so it breaks my VirtualBox setup? Hmm :/

Curiously enough, this does not happen with VirtualBox 6.

Last edited 17 months ago by draget (previous) (diff)
Note: See TracTickets for help on using tickets.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette