VirtualBox/Setting up a Virtual Machine/Ubuntu

< VirtualBox < Setting up a Virtual Machine

Once you have VirtualBox installed on your host computer -- it doesn't matter if your host OS is Linux, MacOS, or something else -- setting up an Ubuntu virtual machine is easy.

host operating system pre-install steps

installing inside the virtual machine

The previous steps created .vdi file that acts like a fresh, empty hard drive, and now we're going to install Ubuntu on it exactly the same we would on a physical machine with a physical fresh, empty hard drive.

So, are we finished installing?

return to the host operating system for further installation steps

Next we install the Guest Additions.[3]


A few things you can do with this virtual machine


If your purpose for setting up this machine is to practice administering RAID arrays -- setting up a new RAID array, failing, operating while degraded, adding empty hard drives to the array, rebuilding, scrubbing, etc. -- in a safe sandboxed environment, you can add and remove additional virtual hard drive images at any time under Settings >> Storage.


You can easily move this virtual machine to some other computer -- even a computer running a completely different host operating system. (One exception: 64-bit Ubuntu will not run on 32-bit hardware. 32-bit Ubuntu, however, runs fine on both 64-bit Intel processors and 32-bit Intel processors.)

An operating system inside a virtual machine may see several hard drives. Typically they are all actually ".vdi" files stored on a single host hard drive. But some people tweak the VirtualBox settings so that the operating system can directly access (perhaps in read-only mode) physical drive(s), so the hard drive that guest operating system sees is, in fact, a physical hard drive.

Many people disable the "fading windows" effect and other pretty effects by installing "CompizConfig Settings Manager" and turning off "effects" and "Enhanced Zoom Desktop".

Many people install and use a "fast, lightweight" window manager such as GNOME Flashback (Metacity)[8] or XFCE,[9]

To try out Xubuntu (with XFCE), at the command line type "sudo apt-get install xubuntu-desktop gksu leafpad synaptic" (not including the quotes). Then press enter, type your password, then press enter again. It takes a few minutes for Ubuntu to download and install the Xubuntu stuff. Then log out of Ubuntu. At the login window, click the logo next to your user name, and pick "Xubuntu session".

Some people install zRam for better performance with limited RAM. This is a single command in Ubuntu 12.04 and newer: open a terminal window, and run[10]

   sudo apt-get install zram-config

Using ssh to access an Ubuntu virtual machine

Inside the virtual machine window, you can open a terminal window and ssh to some other server -- that's all installed by default.

Often people want to access a text terminal on an Ubuntu server from a Windows box -- that takes a few more steps:[11][12]

OR

   sudo apt-get install openssh-server
   sudo vim /etc/ssh/sshd_config
   PasswordAuthentication no

then save that file and exit.

   sudo /etc/init.d/ssh restart

You should be able to log into the virtual machine now.


Further reading

  1. EFF. "Privacy in Ubuntu 12.10: Full Disk Encryption".
  2. Dustin Kirkland. "Ubuntu’s Encrypted Home Directory: A Canonical Approach to Data Privacy".
  3. VirtualBox manual. "Guest Additions".
  4. Ask Ubuntu. "How do I install Guest Additions in a VirtualBox VM?".
  5. VirtualBox bug tracker. "Ticket #1591 (closed defect: fixed)": "auto-resize guest display is greyed out".
  6. "virtualbox resolution above 800x600".
  7. "Screen Resolution, VirtualBox Guest Additions, Ubuntu, and You".
  8. Pjotr. "Do this first in Ubuntu 14.04 LTS"
  9. Pjotr. "Turn Ubuntu 14.04 into Xubuntu 14.04"
  10. Andrew. "Increased performance in Linux with zRAM (virtual swap compressed in RAM)"
  11. Ubuntu. "SSH/OpenSSH/Configuring".
  12. "Enable SSH in Ubuntu 14.04 Trusty Tahr".
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.