LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-02-2020, 07:28 PM   #1
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Rep: Reputation: 61
Talking How can I make Virtualbox Virtual Machines launch when KDE loads?


One of my VM's is a Windows machine running some software and I need to actually see the VM (not headless). It's not a huge deal to manually click on the shortcuts or launch the VM's from Virtualbox Control Manager but it'd be nice to be able to have them auto launch when the machine turns on and logs me in.

I've tried using KDE's Autostart system, no combination of things I tried actually made the VM's launch. I figure if I create Desktop Shortcuts to the VMs, surely there is a way to make KDE "double click" on those shortcuts once KDE has launched, right?

Thanks for your help!

Ps. I see that there is a way to launch virtualboxes doing something like this but surely there is a simpler way?
 
Old 03-03-2020, 09:19 AM   #2
DarrenDrapkin
Member
 
Registered: Aug 2014
Location: Leeds, England
Distribution: Slackware x86 64 version 15.0
Posts: 127
Blog Entries: 3

Rep: Reputation: 27
I have not used Virtualbox in Linux myself, but have you tried to launch your virtual machines and then 'save session' from the leave menu.
 
1 members found this post helpful.
Old 03-03-2020, 12:10 PM   #3
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Original Poster
Rep: Reputation: 61
Quote:
Originally Posted by DarrenDrapkin View Post
I have not used Virtualbox in Linux myself, but have you tried to launch your virtual machines and then 'save session' from the leave menu.
I have not, that might work, but if there is a power outage they won't come back on, even though the machine will due to it's bios config.
 
Old 03-03-2020, 12:12 PM   #4
Timothy Miller
Moderator
 
Registered: Feb 2003
Location: Arizona, USA
Distribution: Debian, EndeavourOS, OpenSUSE, KDE Neon
Posts: 4,005
Blog Entries: 26

Rep: Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521Reputation: 1521
I know nothing about Virtualbox, but in virt-manager there is an option for VM's to "start VM upon host boot up". Possibly a similar option in Vbox?
 
1 members found this post helpful.
Old 03-03-2020, 12:55 PM   #5
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,504

Rep: Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490
You don't indicate which distribution of Linux you are using or which kde. Which combination of things did you try? On my machine with kde 4.14.38, I put the 1 liner below in a bash script in /home/user/.kde/Autostart and it runs virtualbox on login.

Code:
#!/bin/bash
/usr/bin/virtualbox
 
1 members found this post helpful.
Old 03-03-2020, 04:58 PM   #6
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Original Poster
Rep: Reputation: 61
Quote:
Originally Posted by yancek View Post
You don't indicate which distribution of Linux you are using or which kde. Which combination of things did you try? On my machine with kde 4.14.38, I put the 1 liner below in a bash script in /home/user/.kde/Autostart and it runs virtualbox on login.

Code:
#!/bin/bash
/usr/bin/virtualbox
I am using Kubuntu 18.04.

I don't want Virtualbox to run, I want to launch a virtual machine in Virtualbox, not sure if that's what you meant or not. Virtualbox itself can create "shortcuts" which are icons on the desktop, I double click these and the VM launches. I've tried every combination of these Shortcuts with KDE's built in Autostart feature that I could think of.

I was told I should try adding a sleep before executing the shortcut. I will try that next.
 
Old 03-03-2020, 05:44 PM   #7
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,504

Rep: Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490
OK, I misunderstood your question. I have android installed in VirtualBox and the script below in the same location as above starts android on boot. You can use either the name or the UUID.

Code:
#!/bin/bash
vboxmanage startvm android
 
1 members found this post helpful.
Old 03-03-2020, 05:50 PM   #8
wh33t
Member
 
Registered: Oct 2003
Location: Canada
Posts: 922

Original Poster
Rep: Reputation: 61
Quote:
Originally Posted by yancek View Post
OK, I misunderstood your question. I have android installed in VirtualBox and the script below in the same location as above starts android on boot. You can use either the name or the UUID.

Code:
#!/bin/bash
vboxmanage startvm android
Thank you. I ended up doing something similar and they now automatically launch at startup as hoped/expected. I really appreciate the help. I really didn't want to go through the suggested solutions I had already found.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] virtualbox is installed along with virtualbox-dkms and virtualbox-ext-pack and linux-headers-generic, but error for no /dev/vboxdrv Astral Axiom Linux - Software 2 03-04-2019 08:09 PM
How can I use kickstart to build multiple virtual machines on Oracle virtual box? VitalTrainings Linux - Newbie 1 08-29-2014 09:04 AM
LXer: Launch batches of self-configuring virtual machines LXer Syndicated Linux News 0 03-07-2009 09:30 AM
Launch command whe KDE Loads - SUSE 9.1 jmoulinier Linux - Software 1 08-24-2004 12:00 AM
installed dropline, root loads kde3.2, user loads drop pgrimes Linux - Software 7 06-28-2004 06:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration