0

On Ubuntu 14.04, I installed VirtualBox on which I have created 2 Ubuntu virtual machines.

Does Ubuntu provide a way to launch the virtual machine I want at a particual moment ? Is there any solution for this problem by developing a .sh script for example or using any other programming language ?

NiceMan
  • 3
  • 3
  • see http://askubuntu.com/questions/404665/how-to-start-virtual-box-machines-automatically-when-booting for starting on boot – Takkat Jun 04 '14 at 11:53

1 Answers1

2

VirtualBox has a command line utility called VBoxManage that can be used to control virtual machines (VMs). You can read the documentation here: Chapter 8. VBoxManage.

The command to start a VM is:

VBoxManage startvm <NameOfVMHere>

If the name of your VM has spaces, you have to enclose it in "quotations". You can use the following command to list your VMs to see their names:

VBoxManage list vms

Armed with this information, you can now create a script that will run this command for you under the conditions you want. You did not mention what is this "particular moment" you want to start the VM in, so we cannot further help you with the script.

Also, it is worth noting that there is a lot more to the VBoxManage command. You can start the VM with a window GUI, or without a GUI at all (if that's what you're looking for). Take a look at the documentation link I listed above as well as this: Chapter 7. Remote virtual machines, VBoxHeadless.

Alaa Ali
  • 31,535