Setting up a Virtual Machine

vmware_logo_128Part 1 of “Creating a Virtual Development Environment”

In this small series, I am going to show you how to setup a virtual machine. We are going to setup an Ubuntu LTS Server that runs your typical LAMP (Linux, Apache, MySQL, PHP) configuration. I will also discuss additional tools I use for development. I will finish by setting up a Virtual Host that you can access through the desktop. This article will focus on setting up Ubuntu as a virtual machine.

 

What is a Virtual Machine?

A virtual machine (VM) is nothing more than a software implementation of a machine that represents the environment of a real machine.  You use virtual machines when you don’t want to setup an entire machine dedicated to one operating system. VMs are nice for testing out new operating systems and software, but our primary use is to run code that will be delivered by the server itself from the Internet.

Getting Started with VMWare

To run our VM, we are going to use software from VMWare (vmware.com). The environments that you run in VMs are called ‘appliances’. VMWare offers two environments to run appliances: VMWare Player (free version) and VMWare Workstation (commercial version). Some additional features that VMWare Workstation provides are running multiple appliances, creating snapshots, and creating images of your configuration.

Though I will be using VMWare Workstation, I would recommend installing VMWare Player to get started. You can always upgrade to Workstation later. Once you have downloaded either environment, just go through the installation with all the default settings.

To download VMWare Player : http://www.vmware.com/products/player/
To download VMWare Workstation: http://www.vmware.com/products/ws/

Download the Appliance - Ubuntu 8.04 LTS Server

There are hundreds of VMWare appliances provided by the community ready to download and use. You can search through the entire library here: http://www.vmware.com/appliances/

We are going to download the Ubuntu LTS Server appliance. The version I am using for this article is Ubuntu 8.04 LTS Server. You should be able to follow the steps below regardless of the version you choose.

Reference to the appliance I downloaded:
http://www.vmware.com/appliances/directory/53499

Direct link to the appliance I downloaded
http://linhost.info/?download=Ubuntu%208.04%20Server

Most of the appliances are compressed using common formats 7-Zip (7-zip.org) or Torrent. Extract the files into a location. I store mine a C:applicances. The entire package extracted to C:appliancesUbuntu804Server-VM_1.4Ubuntu804Server-VM_1.4 once completed.

Running the Appliance as a Virtual Machine

Running an appliance is actually pretty simple. You can either go into the directory where there files are locate and find the VMWare workstation file with the extension (*.vmx) and double-click on it, or through VMWare Player select open and browse to the file. In VMWare Player, the appliance will run automatically. If you are using VMWare workstation, you will select ‘Power on this virtual machine’ to initialize. The player may ask you if the files have been moved or copied. Select the default ‘copied’ and continue. The VM will start and the server will go through some configuration settings. And you will then be left at the user/pass prompt. Congratulations! You are now running a virtual instance of Ubuntu. You can follow the instructions for logging in - user: sysadmin, pass: sysadmin

vm_ubuntu

 

I am only going to go over a few commands to just setup our environment for future articles. If you want to learn some more common commands, go here - https://help.ubuntu.com/community/UsingTheTerminal

Changing the root password

Once you login, let’s change the root password to something we can always remember. If you ever want to login as the root, knowing the password can be handy. To change the password of root, type:

sudo passwd root

Change the password to “pass”, in order to keep it simple for our purposes. SUDO stands for “Super User Do” allowing administrative privileges into the system. To read more about it go here: http://en.wikipedia.org/wiki/Sudo.

Updating the Advanced Packaging Tool (APT)

These appliances may not be up to date with some of their system caches. One of the applications we definitely want to update is the Advanced Packaging Tool (APT). This interface works with core libraries to handle installing software. If we don’t update it, it is likely that it will have problems installing the libraries from the Internet. To update APT, type:

sudo apt-get update

Once the update is complete, I would recommend reviewing some of the common commands used for navigating and listing files and directories; managing files (create, remove, copy, etc); and editing files using some of the common built-in editors such as “nano”.


  • No Related Post
bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark
tabs-top


3 Responses to “Setting up a Virtual Machine”

  1. wrisruriouh says:

    Hi, cool site, good writing ;)

  2. nospoiler says:

    Great tutorial. I know the VMWare Player is free, but there exists free alternatives to the Workstation - like VirtualBox:

    http://www.virtualbox.org/

  3. Rob says:

    @nospoiler - Thanks. I was not aware of this product. It is good to have alternatives to commercial versions.