[SOLVED] Running guest machines show as powered off in Virtualbox

Discussions related to using VirtualBox on Linux hosts.
Post Reply
0xfffff
Posts: 3
Joined: 19. Feb 2024, 05:28

[SOLVED] Running guest machines show as powered off in Virtualbox

Post by 0xfffff »

Running guest machines show as powered off in Virtualbox


Questions:

I have many VMs in virtualbox, some VMs were created by Vagrant, others created manually via GUI. But whenever I start VMs using vboxmanage starvm, the state of the VM shows as Powerd Off in GUI or vboxmanage showvminfo, even if the VM is running in GUI.

The host OS is Manjaro with R9-7945HX processor, and secure boot is disabled.

Code: Select all

(base) 0x00 in ~/Hypervisor/virtual-machines/Tools/Gparted/Logs λ inxi 
CPU: 16-core AMD Ryzen 9 7945HX with Radeon Graphics (-MT MCP-)
speed/min/max: 1055/400/5461 MHz Kernel: 6.7.0-0-MANJARO x86_64 Up: 4h 8m
Mem: 8.47/30.53 GiB (27.8%) Storage: 2.75 TiB (22.9% used) Procs: 544
Shell: Zsh inxi: 3.3.33
Reproduce:

eg. start a VM called Gparted.

Code: Select all

(base) 0x00 in ~/Hypervisor/virtual-machines/Tools/Gparted/Logs λ vboxmanage startvm Gparted                       
Waiting for VM "Gparted" to power on...
VM "Gparted" has been successfully started.

(base) 0x00 in ~/Hypervisor/virtual-machines/Tools/Gparted/Logs λ vboxmanage showvminfo Gparted | grep State
State:                       powered off (since 2024-02-22T08:25:59.000000000)
                                                                                                                                                                                      
(base) 0x00 in ~/Hypervisor/virtual-machines/Tools/Gparted/Logs λ vboxmanage list runningvms                
                                                                                                                                                                                      
(base) 0x00 in ~/Hypervisor/virtual-machines/Tools/Gparted/Logs λ 
When the GUI pops up there is no distinct errors , though you can see that the state of the machine is not matched as expected.

Image

But in the processes list the VM shows as running

Code: Select all

(base) 0x00 in /var/log λ ps -ef | grep -iE 'vbox|virtual|slot'  | grep -v grep
root         467       2  0 12:39 ?        00:00:00 [iprt-VBoxTscThread]
0x00       53520    1638  0 15:51 ?        00:00:11 /usr/lib/virtualbox/VirtualBox
0x00       53539    1096  0 15:51 ?        00:00:02 /usr/lib/virtualbox/VBoxXPCOMIPCD
0x00       53545    1096  0 15:51 ?        00:00:06 /usr/lib/virtualbox/VBoxSVC --auto-shutdown
0x00       72847    1096  0 16:51 ?        00:00:01 /usr/lib/virtualbox/VBoxXPCOMIPCD
0x00       72853    1096  0 16:51 ?        00:00:05 /usr/lib/virtualbox/VBoxSVC --auto-shutdown
0x00       72881   72853  0 16:51 ?        00:01:09 /usr/lib/virtualbox/VirtualBoxVM --comment Gparted --startvm 4c830005-8675-45da-bc9f-a11964d3f610 --no-startvm-errormsgbox
Kernel ring buffer after clear dmesg -C (before the VM started)

Code: Select all

(base) 0x00 in /var/log λ sudo dmesg            
[15066.546635] vboxdrv: 0000000037a5da6e VMMR0.r0
[15066.652917] vboxdrv: 00000000a81b79f7 VBoxDDR0.r0
There is no distinct errors in vbox.log


download/file.php?mode=view&id=52145

Full information of vboxmanage showvminfo Gparted

Code: Select all

(base) 0x00 in ~/.config λ vboxmanage showvminfo Gparted 
Name:                        Gparted
Encryption:     disabled
Groups:                      /Tools
Guest OS:                    Debian (64-bit)
UUID:                        4c830005-8675-45da-bc9f-a11964d3f610
Config file:                 /home/0x00/Hypervisor/virtual-machines/Tools/Gparted/Gparted.vbox
Snapshot folder:             /home/0x00/Hypervisor/virtual-machines/Tools/Gparted/Snapshots
Log folder:                  /home/0x00/Hypervisor/virtual-machines/Tools/Gparted/Logs
Hardware UUID:               4c830005-8675-45da-bc9f-a11964d3f610
Memory size:                 2048MB
Page Fusion:                 disabled
VRAM size:                   16MB
CPU exec cap:                100%
HPET:                        disabled
CPUProfile:                  host
Chipset:                     piix3
Firmware:                    BIOS
Number of CPUs:              4
PAE:                         disabled
Long Mode:                   enabled
Triple Fault Reset:          disabled
APIC:                        enabled
X2APIC:                      enabled
Nested VT-x/AMD-V:           disabled
CPUID Portability Level:     0
CPUID overrides:             None
Boot menu mode:              message and menu
Boot Device 1:               Floppy
Boot Device 2:               DVD
Boot Device 3:               HardDisk
Boot Device 4:               Not Assigned
ACPI:                        enabled
IOAPIC:                      enabled
BIOS APIC mode:              APIC
Time offset:                 0ms
BIOS NVRAM File:             /home/0x00/Hypervisor/virtual-machines/Tools/Gparted/Gparted.nvram
RTC:                         UTC
Hardware Virtualization:     enabled
Nested Paging:               enabled
Large Pages:                 enabled
VT-x VPID:                   enabled
VT-x Unrestricted Exec.:     enabled
AMD-V Virt. Vmsave/Vmload:   enabled
IOMMU:                       None
Paravirt. Provider:          Default
Effective Paravirt. Prov.:   KVM
State:                       powered off (since 2024-02-22T08:51:04.000000000)
Graphics Controller:         VMSVGA
Monitor count:               1
3D Acceleration:             disabled
2D Video Acceleration:       disabled
Teleporter Enabled:          disabled
Teleporter Port:             0
Teleporter Address:          
Teleporter Password:         
Tracing Enabled:             disabled
Allow Tracing to Access VM:  disabled
Tracing Configuration:       
Autostart Enabled:           disabled
Autostart Delay:             0
Default Frontend:            
VM process priority:         default
Storage Controllers:
#0: 'IDE', Type: PIIX4, Instance: 0, Ports: 2 (max 2), Bootable
  Port 1, Unit 0: UUID: 0454109d-478c-44ac-b34a-f9ce5530f095
    Location: "/home/0x00/Hypervisor/iso/gparted-live-1.5.0-1-amd64.iso"
#1: 'SATA', Type: IntelAhci, Instance: 0, Ports: 1 (max 30), Bootable
  Port 0, Unit 0: UUID: 4c07cc72-0522-4517-b2ca-ce18d1e90159
    Location: "/home/0x00/Hypervisor/virtual-machines/Tools/Gparted/Snapshots/{4c07cc72-0522-4517-b2ca-ce18d1e90159}.vdi"
NIC 1:                       MAC: 080027F03201, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
NIC 1 Settings:  MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)
NIC 2:                       disabled
NIC 3:                       disabled
NIC 4:                       disabled
NIC 5:                       disabled
NIC 6:                       disabled
NIC 7:                       disabled
NIC 8:                       disabled
Pointing Device:             USB Tablet
Keyboard Device:             PS/2 Keyboard
UART 1:                      disabled
UART 2:                      disabled
UART 3:                      disabled
UART 4:                      disabled
LPT 1:                       disabled
LPT 2:                       disabled
Audio:                       enabled (Driver: Default, Controller: AC97, Codec: AD1980)
Audio playback:              enabled
Audio capture:               disabled
Clipboard Mode:              disabled
Drag and drop Mode:          disabled
VRDE:                        disabled
OHCI USB:                    enabled
EHCI USB:                    enabled
xHCI USB:                    disabled
USB Device Filters:          <none>
Bandwidth groups:            <none>
Shared folders:              <none>
Recording enabled:           no
Recording screens:           1
 Screen 0:
    Enabled:                 yes
    ID:                      0
    Record video:            yes
    Destination:             File
    File:                    /home/0x00/Hypervisor/virtual-machines/Tools/Gparted/Gparted-screen0.webm
    Options:                 vc_enabled=true,ac_enabled=false,ac_profile=med
    Video dimensions:        1024x768
    Video rate:              512kbps
    Video FPS:               25fps
* Snapshots:
   Name: Pure (UUID: 02dc5814-0b25-428f-a52b-92ba2b6be4f0) *
* Guest:
Configured memory balloon:   0MB


Things I tried:

1. Remove the .vbox-<username>-ipc directory mention in ch02.html#2.3.5. Starting Oracle VM VirtualBox on Linux

2. Upgrade/downgrade virtualbox/linux kernel didn’t work

3. Start virtualbox as root and create a virtual machine usinig the same ISO, then to reproduce the steps mentioned above. The state mathced as expected !!! (runnging-running)

It’s various from

viewtopic.php?p=426125

4. Tried to read some source code, but didn’t find the function that handle starvm subcommand



Any of workarounds or hints would be appreciated



[English is not my native lanuage, if some expression make you confuse]



Thanks
Attachments
VBox.log
(91.31 KiB) Downloaded 22 times
Last edited by 0xfffff on 8. Mar 2024, 09:14, edited 2 times in total.
klaus
Oracle Corporation
Posts: 1139
Joined: 10. May 2007, 14:57

Re: Running guest machines show as powered off in Virtualbox

Post by klaus »

Must be caused by differences in the environment variables resulting in two VBoxSVC processes getting started, using different /tmp/.vbox-<username>-ipc... the question is what's different.

And don't delete .vbox-<username>-ipc when any VM is running, because it will *create* such a "split brain" situation.
0xfffff
Posts: 3
Joined: 19. Feb 2024, 05:28

Re: Running guest machines show as powered off in Virtualbox

Post by 0xfffff »

Hi klaus, thanks for replying

If I boot the VM in GUI directly, there is one VBoxSVC process.
If I open the Virtualbox GUI first, then run vboxmanage startvm Gparted, there is two VBoxSVC processes.

I have checked the environment variables before, but it appears that none of variables are related to virtualbox, except VBOX_RELEASE_LOG=guest_dnd.e.l.l2.l3.f which was set manually for DnD debugging.
I also have purged the ~/.zshrc and ~/.bashrc, it didn't work.

And here is all my environment variables before purging

Code: Select all

COLORFGBG=15;0
COLORTERM=truecolor
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
DESKTOP_SESSION=plasma
DISPLAY=:0
GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/0x00/.gtkrc-2.0:/home/0x00/.config/gtkrc-2.0
GTK3_MODULES=xapp-gtk3-module
GTK_IM_MODULE=fcitx
GTK_MODULES=canberra-gtk-module
GTK_RC_FILES=/etc/gtk/gtkrc:/home/0x00/.gtkrc:/home/0x00/.config/gtkrc
HOME=/home/0x00
INVOCATION_ID=928b305cd5d14eea958cb72be19679fe
JOURNAL_STREAM=8:9157
KDE_APPLICATIONS_AS_SCOPE=1
KDE_FULL_SESSION=true
KDE_SESSION_UID=1000
KDE_SESSION_VERSIOunset SSH_AGENT_PID
if [ "${gnupg_SSH_AUTH_SOCK_by:-0}" -ne $$ ]; then
    export SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)"
fi
export GPG_TTY=${TTY:-"$(tty)"}
gpg-connect-agent updatestartuptty /bye >/dev/null
N=5
KONSOLE_DBUS_SERVICE=:1.59
KONSOLE_DBUS_SESSION=/Sessions/1
KONSOLE_VERSION=230804
LANG=en_US.UTF-8
LANGUAGE=
LC_ADDRESS=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_PAPER=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_TIME=en_US.UTF-8
LOGNAME=0x00
MAIL=/var/spool/mail/0x00
MANAGERPID=1308
MEMORY_PRESSURE_WATCH=/sys/fs/cgroup/user.slice/user-1000.slice/user@1000.service/app.slice/app-org.kde.yakuake@autostart.service/memory.pressure
MEMORY_PRESSURE_WRITE=c29tZSAyMDAwMDAgMjAwMDAwMAA=
MOTD_SHOWN=pam
OLDPWD=/home/0x00
PAM_KWALLET5_LOGIN=/run/user/1000/kwallet5.socket
PATH=/home/0x00/anaconda3/bin:/home/0x00/anaconda3/condabin:/home/0x00/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/var/lib/flatpak/exports/bin:/usr/lib/jvm/default/bin:/opt/nessus/bin:/opt/nessus/sbin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/var/lib/snapd/snap/bin
PROFILEHOME=
PT8HOME=/opt/packettracer/
PWD=/home/0x00
QT_AUTO_SCREEN_SCALE_FACTOR=0
QT_IM_MODULE=fcitx
QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
QT_SCREEN_SCALE_FACTORS=eDP=1.25;DisplayPort-0=1.25;DisplayPort-1=1.25;DisplayPort-2=1.25;
SESSION_MANAGER=local/0xff1:@/tmp/.ICE-unix/1412,unix/0xff1:/tmp/.ICE-unix/1412
SHELL=/usr/bin/zsh
SHELL_SESSION_ID=0997b079b4ff43d9bcb5d9b8a633000b
SYSTEMD_EXEC_PID=1658
TERM=xterm-256color
USER=0x00
VBOX_RELEASE_LOG=guest_dnd.e.l.l2.l3.f
WINDOWID=62914570
XAUTHORITY=/tmp/xauth_yQsuNK
XCURSOR_SIZE=28
XCURSOR_THEME=Bibata-Original-Classic
XDG_CONFIG_DIRS=/home/0x00/.config/kdedefaults:/etc/xdg:/usr/share/manjaro-kde-settings/xdg
XDG_CURRENT_DESKTOP=KDE
XDG_DATA_DIRS=/home/0x00/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/var/lib/snapd/desktop
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_SESSION_CLASS=user
XDG_SESSION_DESKTOP=KDE
XDG_SESSION_ID=2
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session1
XDG_SESSION_TYPE=x11
XDG_VTNR=2
XMODIFIERS=@im=fcitx
SHLVL=1
ZSH=/home/0x00/.oh-my-zsh
VISUAL=/usr/bin/subl
EDITOR=/usr/bin/vim
UPDATE_ZSH_DAYS=30
FZF_BASE=/usr/share/fzf
PAGER=less
LESS=-R
LSCOLORS=Gxfxcxdxbxegedabagacad
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=00:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.avif=01;35:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:*~=00;90:*#=00;90:*.bak=00;90:*.crdownload=00;90:*.dpkg-dist=00;90:*.dpkg-new=00;90:*.dpkg-old=00;90:*.dpkg-tmp=00;90:*.old=00;90:*.orig=00;90:*.part=00;90:*.rej=00;90:*.rpmnew=00;90:*.rpmorig=00;90:*.rpmsave=00;90:*.swp=00;90:*.tmp=00;90:*.ucf-dist=00;90:*.ucf-new=00;90:*.ucf-old=00;90:
FZF_DEFAULT_COMMAND=fd --type f --hidden --exclude .git
CONDA_EXE=/home/0x00/anaconda3/bin/conda
_CE_M=
_CE_CONDA=
CONDA_PYTHON_EXE=/home/0x00/anaconda3/bin/python
CONDA_SHLVL=1
CONDA_PREFIX=/home/0x00/anaconda3
CONDA_DEFAULT_ENV=base
CONDA_PROMPT_MODIFIER=(base) 
SSH_AUTH_SOCK=/run/user/1000/gnupg/S.gpg-agent.ssh
GPG_TTY=/dev/pts/2
_=/usr/bin/env
And VBoxSVC.log in the attachement
Attachments
VBoxSVC.log
(6.75 KiB) Downloaded 17 times
Last edited by 0xfffff on 23. Feb 2024, 04:00, edited 6 times in total.
0xfffff
Posts: 3
Joined: 19. Feb 2024, 05:28

Re: Running guest machines show as powered off in Virtualbox

Post by 0xfffff »

In /usr/bin/VBox, I find the result of SERVER_PID=`ps -U \`whoami\` | grep VBoxSVC | awk '{ print $1 }'` always empty, if I change to SERVER_PID=`ps -ef | grep VBoxSVC | awk '{ print $1 }'` for temporary use, then the state of VMs matched

Code: Select all

(base) 0x00 in ~ λ id 
uid=1000(0x00) gid=1000(0x00) groups=1000(0x00),3(sys),90(network),98(power),108(vboxusers),952(libvirt),956(docker),991(lp),998(wheel)

(base) 0x00 in ~ λ ps -fu 0x00 | grep -i vbox | grep -v grep
root         468       2  0 09:02 ?        00:00:00 [iprt-VBoxTscThread]
                                                                                                                                                                                      
(base) 0x00 in ~ λ ps -fu 1000 | grep -i vbox | grep -v grep
0x00       35855    1332  0 10:44 ?        00:00:02 /usr/lib/virtualbox/VBoxXPCOMIPCD
0x00       35861    1332  0 10:44 ?        00:00:05 /usr/lib/virtualbox/VBoxSVC --auto-shutdown
The root cause is the abnormal username 0x00

Tag this question as solved.
Last edited by 0xfffff on 26. Feb 2024, 05:54, edited 8 times in total.
Post Reply