Monday, November 5, 2018

creating a sample VM and showing the GUI

VM: An embedded computer which runs on Virtualbox.

Below we create a VM for Ubuntu.


# creates a vagrant file on current directory
vagrant init hashicorp/precise32

#to use vagrant file and create the vm and start using it.

vagrant up

# to connect to it and opens the console to the VM.Where we can execute commands
vagrant ssh

#to exit from VM 
exit

To check the status of machine use vagrant status.And with --debug switch for more details.

To check a VM is created and being used using virtualbox commandline.runningvms is for current powered on VMs and to get complete list use just vms.

vboxmanage list runningvms

To make the VM visible instead of Headless.

In the vagrant file, uncomment below section and change the value of vb.gui to true and remove any unusable lines in that section.

config.vm.provider "virtualbox" do |vb|
  vb.gui=true
end

Once the file is saved, you need to reopen the VM with new settings. So, use the command.
And connect to the VM using GUI with user/password vagrant.

vagrant reload

No comments:

Post a Comment