Forum › Forums › New users › New Users and General Questions › Autostart virtualbox VM with specific user › Reply To: Autostart virtualbox VM with specific user
Hi, I stumbled across this post and have one clarifying question.
Do you want to run the VM:
(1) Start the VM immediately after you login as the user (without the GUI of the VirtualBox program itself)?
1.A) Log in as the user.
1.B) The VM will be automatically started immediately after 1.A), i.e. there will be a slight delay due to the start-up of the VM (depends on the resources of your PC).
(2) At boot, i.e. somehow boot into the VM run in antiX (without starting the user desktop session at all)?
Expected steps in this scenario
1.A) Start the machine during boot as a specific user.
1.B) Log in as the user.
1.C) The VM is already there, up and running (no VM’s startup delay as it was already started prior to the user’s log-in).
Variant (1):
I have successfully tested the command (which I was previously unaware of)
vboxmanage startvm <name> --type gui &
and it works.
You can add the (appropriately modified) command suggested above by Xecure to user’s start-up file ‘/home/<user>/.desktop-session/startup’.
This means that once the user logs in, the command will be executed, i.e. the VM will be launched.
Variant (2):
Creating a service called at startup, run as the specific user (could require executed as root (?), probably with ‘sudo -u <user> [-E]’ …)…
Frankly, I am not sure how the VM’s GUI could be “attached” to the non-existing X11 session of the user (not logged in yet).