Posts Chef Solo with virtualbox and vagrant part 2
Post
Cancel

Chef Solo with virtualbox and vagrant part 2

  • Login to Guest Box

You can login to the guest box using vagrant or ssh client example putty.

Via vagrant command

Execute form the same folder location that we were in

1
$ vagrant ssh

This will log you into the guest operating system that was booted by vagrant

Via Putty

Since this virtual machine is running on your computer.

We know that loop back IP address is 127.0.0.1 and from above output the virtual machine SSH port is 2222.

So start putty and execute the below steps

Enter 127.0.0.1 In host name or IP address section.

Select SSH radio in connection type.

Update Port to 2222

Click on “Open” button to connect to this configuration

A new window will open, and you will see the below output.

Using username “vagrant”.

1
2
3
4
5
vagrant@localhost's password:

# Enter "vagrant" as password (without quotes).
# You will see the below output.
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic x86_64)

Documentation

  • Stop Virtual Machine

The above created virtual machine can be stopped by two ways

By using vagrant

Execute the below command on the guest OS

1
$ exit

This command will exit from the guest OS but will keep it running.

1
$ vagrant halt

This command will shut down the VM

By using Linux poweroff command

Execute the below command on the guest OS

1
sudo poweroff

This command will use the super user access and will then start the shutdown sequence on the guest OS

  • Destroying the VM

To destroy or delete the above created virtual machine.

Execute form the same folder location that we were in

1
$ vagrant destroy

to force destroy

1
$ vagrant destroy -f

The first command will ask for a user confirmation before deleting the VM, whereas in the second case VirtualBox will silently proceed and delete the VM.

This post is licensed under CC BY 4.0 by the author.