Score:1

Virtualbox VBoxManage show only results with sudo many info inside what I already tried in other post?

ge flag

When I run this als normal user :

VBoxManage list runningvms

No results, also no error output, its compleet empty ....

When I run this with sudo : sudo VBoxManage list runningvms

is see my VM is running "homeassistant" {5e97e033-e726-41ec-a3aa-3f8e6b4bf448}

The normal user is

  • a member of vboxusers
  • remove this folder rm -r ~/.config/VirtualBox
  • set the folder permission with sudo chmod -R 752 ~/.config/VirtualBox

The problem is, I want to auto start the VM on a reboot, so I made a custom service

/etc/systemd.system/ha.service

[Unit] Description=vm1 After=network.target virtualbox.service Before=runlevel2.target shutdown.target [Service] User=ovm Group=ovm Type=forking Restart=no TimeoutSec=5min RemainAfterExit=yes ExecStart=/bin/bash /home/hans/startha.sh [Install] WantedBy=multi-user.target

/home.hans/startha.sh #! /bin/bash sleep 40 VBoxManage startvm homeassistant --type headless

reload the config sudo systemctl daemon-reload

enable the service systemctl enable ha.service

reboot and after a couple of minutes check, but the user has no rights to start a VM so how to handle this ?

systemctl status ha

ha.service - vm1 Loaded: loaded (/etc/systemd/system/ha.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Tue 2023-04-18 13:41:08 EDT; 5min ago Process: 1119 ExecStart=/bin/bash /home/hans/startha.sh (code=exited, status=217/USER) CPU: 1ms

running Debian uch uch with no GIU, the VMS is setup from terminal and is running fine when I start it with sudo

** edit ** when i run sudo ./startha.sh from user hans the vm is starting normal ....

petep avatar
in flag
Change type in systemd file to "oneshot" and or change sudoers file to make command to use without sudo passwd. Or try runas command instead.
Score:1
ge flag

it's solved..... for some reason the user has no (execute) rights on the .vbox file on \home....VirtualBox\ VMs

I run udo chmod 777 -R \home....VirtualBox\ VMs
and now can start the vm from a user and autostart is also working.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.