How to reboot or shut down your virtual machine?

Read man pages for shutdown, poweroff, halt, reboot. For example, type on the command line man shutdown to know more about the command, and check details on the parameters you can use with the command.

Various command line examples are:

To reboot, use any one of the following commands:

sudo reboot

sudo shutdown -r now This will perform a system shutdown in a proper way and then reboot the computer.

sudo init 6 

To shut down, use any one of the following commands:

sudo poweroff

sudo shutdown -h now This will perform a system shutdown in a proper way. You can also specify a timer (in seconds), instead of the word "now", for example: shutdown -h -t 30. This will bring the computer down in 30 seconds.

sudo halt is another way to shutdown.

sudo init 0