A Small Virtual Machine for a Test Lab


Get my 57MB Damn Small Linux OVA here (rename file extension from .doc to .ova): DOWNLOAD

While I’m traveling, I use my laptop as a mobile test lab. To do anything of significance, I like to run two VMware ESXi 5 hosts, vCenter Server 5, a domain controller (both on x64 Windows Server 2008 R2) and for my recent study focus, a NetApp DataONTAP 8.1 simulator, all on VMware Workstation 8. All these things are great, but with “only” 8 GB RAM to pull from, my resources are limited and I’m pushing RAM utilization to the max before I even start running VMs, as you can see below. The only thing saving me is an Intel 320 Series SSD.


What I’ve been looking for is a VM that would use as few resources as possible. I also wanted something I could clone and from which to create a template. I also wanted to be able to practice using PowerCLI against these VMs – nothing in particular, but perhaps start with a script to deploy a certain number of VMs from a template automatically. I haven’t gotten around to the PowerCLI part yet, but I have found an excellent start. It’s Damn Small Linux and I’ve created the smallest OVA I could.

For the purposes of my test lab, the least possible RAM utilization was the most important feature I was looking for. Hard disk space consumed by the running VM wasn’t necessarily important, but while making the VM as small as possible, I decided not to include a swap partition. The installation uses about 123 MB thinly provisioned on a 128 MB .vmdk because SSD space is valuable. It also runs on 64 MB of RAM, using a fraction of that when idle and only bit more while executing a continuous ping. In this blog post, I’d like to walk through installing Damn Small Linux (DSL) 4.4.10 to hard disk and then creating an OVA. You can also download my OVA from here. This blog is hosted by WordPress and because WordPress only allows certain file types to be uploaded, the OVA is saved with a .doc file extension. Please rename the .doc to .ova before attempting to use it.

Create a DSL Virtual Machine

I won’t walk you through creating the whole VM. Instead, I’ll hit the high points that are unique to DSL. As a note, I’m creating this inside ESXi 5. Feel free to keep the defaults for everything not mentioned here.

1. Choose a custom installation
2. Guest Operating System – choose “Other 2.4.x Linux (32-bit)”
3. Memory – 64 MB, was way too slow with only 32 MB
4. Create a 128 MB thin provisioned disk
5. Disk type must be IDE, not SCSI

In this example, I’m using the latest DSL build, 4.4.10. I didn’t test other builds. Boot the VM to this ISO.

Close the web browser that opens automatically and left-click the desktop, choosing XShells > Root Access > Transparent.

You’ll have to prepare the .vmdk to accept the OS install. To do this, you’ll use cfdisk and create an ext2 partition. At the prompt, type cfdisk /dev/hda.

The system will see a clean disk. Type ‘y.’

Using the arrow keys, select ‘New.’

Select ‘Primary.’

The system sees the 134 MB for some reason. This is fine, just hit enter.

At the next screen, highlight ‘Bootable’ and you’ll see the flag entered above next to hda1.

Highlight, ‘Type,’ and hit enter.

Press enter at the next screen…

…and type in 83, then enter.

Highlight, ‘Write,’ then enter. Follow the prompts and type, ‘yes.’

That’s it. You’ve finished preparing the disk. Highlight, ‘Quit,’ and press enter.

At the prompt, type, ‘reboot.’ Boot once more from the ISO.

Once you’ve booted back into the DSL ISO, open another root shell and type, ‘dsl-hdinstall.’ The prompts are as follows:

Enter the target partition: hda1
Do you wish to support multi-user logins: no
Use journalized file system: no
Continue: yes

Proceed to install a boot loader? Yes
Use Grub or Lilo: Either is fine, I use Grub
Reboot now: yes

After this last reboot, you’ll be prompted to set the root and normal user (dsl) passwords. Do this, then boot to the desktop.

The VM sees RAM utilization as less than 17 MB and full, 128 MB disk usage. Not bad for a test VM.

What I like to do with the DSL VM is start a continuous ping from a root shell while I perform vMotions and Storage vMotions. Of course, running inside VMware Workstation 8, the host-only network can deploy DHCP so your DSL VMs will automatically pull IP addresses.

Creating an OVA or OVF from here is easy. Issue the ‘halt’ command to shut down your DSL VM. Make sure it’s powered down before continuing.

Create an OVA

Highlight your DSL VM in the left hand pane. Choose File > Export > Export OVF Template… Fill out the appropriate information. Remember that an OVF file will export the .vmdk’s that make up the VM, along with descriptor files for deploying the OVF. I like the OVA format because it’s a single file to manage.

You can see that our VM takes up about 57 MB as an OVA. An OVF is about the same, although you may want to zip up the OVF package for ease of portability.

Conclusion

One thing that would make this VM more useful is getting VMware Tools installed. If anyone has a good walkthrough of that I’d love to see it.

In the end, with six virtual machines running, Windows registers about an 80 MB increase in memory utilization compared to no VMs running inside ESXi.

Looking at my disk performance with Resource Monitor inside my Windows 7 Ultimate host, my Active Time % is hovering above 50%. Again, this is on a solid-state drive. The only other application I’m running is Microsoft Word, but all systems still seem responsive. In fact, according to Resource Monitor, my Response Time is zero or one millisecond for every process and Disk Queue Length is averaging 0.50. Not too shabby. After several minutes of letting the system settle, Active Time is less than 20% and Disk Queue Length is less than 0.20 with response times staying the same. If I quit Microsoft Word, I’m sure I’d see an improvement.


I used this ArsGeek article as a reference when installing DSL

And the other Scott Lowe’s (Twitter @otherScottLowe) article on Windows Resource Monitor was useful, too.

Google


30 Comments on “A Small Virtual Machine for a Test Lab”

  1. […] A Small Virtual Machine for a Test Lab (virtuallymikebrown.com) […]

    • Brad says:

      This is just what I was looking for. I’ve got GNS3 set up to learn more about networking and I can only run about 2 windows vms in it before everything goes to a grinding halt. This will allow me to run at least a dozen vms in different networks!

      Thanks so much!

  2. dl says:

    whats the default root username/password for this ovf?

    • As you actually deploy the OVA from vCenter, the first screen you’ll see in the Deploy OVF Template window in the details section which includes the root password. The default password for root is

      Password123!@#

      Here’s the rest of the information in the OVF Template Details

      ======================================================================
      Created by Mike Brown
      2 February 2012
      http://VirtuallyMikeBrown.com

      This VM was created with the intent of deploying many into a test lab. To that end, the allocated hard disk and RAM sizes are the smallest I could get to work easily.

      128 MB .vmdk
      64 MB RAM
      1 vCPU

      VMware Tools Installed: No

      Configured for DHCP
      Default hostname: box

      No swap partition

      root/Password123!@#
      dsl/Password123!@#
      ======================================================================

      • dl says:

        Thanks, Mike!

      • tom says:

        Deployed ova and trying to enter initial password, anyone else have problems entering the # key, cannot find it to enter initial password :-{ help !

        • Hi Tom,

          It sounds like you can’t find the # key on your keyboard. Is that correct?

          Thanks,

          Mike

          • UNIVIRT says:

            Hi Mike.

            The issue comes when you use special characters in a password. If you have a non-US keyboard layout certain characters can cause issues, including # and @ since they appear in different places on different keyboard layouts. Using my UK layout, hitting # gives me a 3 on your DSL VM. Hitting Shift-3 gives nothing. So I’m afraid I can’t use your VM (although I do appreciate you putting in the effort!).

            I usually stick to just ! as it seems to appear in the same place (Shift-1) on most keyboard layouts.

            Neil.

  3. Arun Garg says:

    Could you please let me know how to install some additional perl modules on the system? I tried enabling/install apt-get but even with that I am not able to install additional perl module I need for my work? Please help.

    • I don’t believe the vmdks are big enough for more data as I’ve rried to make them as small as possible. If you think you’ve run in to a space issue, try building a VM from scratch following this post but using a larger disk size.

      – Mike

  4. Craig says:

    When I try to deploy the OVF I get an error stating “The OVF package is invalid and cannot be deployed: Data at root level is invalid”

  5. […] In the end my stepson advised my to take a look a Damn Small Linux (or DSL which ships as an .ISO), and go from there – if you browse to http://distro.ibiblio.org/damnsmall/current  you should find the latest version. I would aviod the file with the name vmx.zip – this is nothing but a generic VMX that boots from the .ISO image. If you looking for a pre-packed version of DSL you might like to use Mike Brown’s site VirtualMikeBrown.com as he has one pre-made with intructions on how to the install yourself: A Small Virtual Machine for a Test Lab. […]

  6. packetzapper says:

    Hey Mike

    Many thanks for putting this together. Saved me a fair amount of work today.
    Much appreciated

    Jim

  7. Dustin Lema says:

    Thank you Mike! This replaced my small XP VMs I’ve been using since 2008!

  8. MIguel Vega says:

    Great , just what i needed for doing labs for my vcp exam !!
    Thanks man , works great !!

  9. […] One good example of using pre-packaged OVF/OVA virtual machine is so called “Skinny Linux” distributions. These are popular in homelabs where memory and diskspace maybe at a premium. These distributions of Linux use an incredibly small amount of resources, and allow SysAdmins to build lab environments that look and feel much larger than than they actually are. The sources of this distributions are many and varied but often they start the lives as recovery CD-ROMs, which have been installed to disk. However, these Linux distributions are not with limits – they are often not supported by VMware, have very small disk sizes based on IDE virtual disks, and frequently do not contain VMware Tools. This means that features such as reporting the IP address of the VM, or soft reboot/shutdown options are not available. Examples include SliTax and TTYLinux available onmikelaverick.com and DSL hosted on virtualmikebrown.com […]

  10. Eldad says:

    Hi Mike,

    First thanks on the great guide.

    If I want to copy files to the guest VM , how can I copy files from the Windows Host.
    Thanks

  11. […] One good example of using pre-packaged OVF/OVA virtual machine is so called “Skinny Linux” distributions. These are popular in homelabs where memory and diskspace maybe at a premium. These distributions of Linux use an incredibly small amount of resources, and allow SysAdmins to build lab environments that look and feel much larger than than they actually are. The sources of this distributions are many and varied but often they start the lives as recovery CD-ROMs, which have been installed to disk. However, these Linux distributions are not with limits – they are often not supported by VMware, have very small disk sizes based on IDE virtual disks, and frequently do not contain VMware Tools. This means that features such as reporting the IP address of the VM, or soft reboot/shutdown options are not available. Examples include SliTax and TTYLinux available on mikelaverick.com and DSL hosted on virtualmikebrown.com […]

  12. […] A Small Virtual machine for a Test lab This is actually a very small virtual machine. Quite handy.  I used it long ago in some of the virtual pods I built at VMware but I was reminded about it again recently.  If you need a small VM in a nested environment this is a good one. […]

  13. gt57 says:

    I have a need for several small test boxes for my network lab. I have a very basic knowledge of Linux and was looking for a pre-packaged OVA that would fit my needs. This version looks good.

    One issue I have with other distributions, such as TinyCore, is getting telnetd installed. I want to use a telnet client to access the console of my many virtual Linux VMs. Does this version have telnetd or would it be possible to add?

  14. […] virtual machine created using Mike Brown’s Tiny VM to minimise inter site link bandwith consumption.  Note this doesn’t have VMware Tools […]

  15. niko says:

    hi
    i also can not find the @ and the # on the keyboard so i can enter the password
    thanks

  16. Eldad says:

    Hi,

    Great post and info. Keep it going.
    Can you please elaborate what is your mobile lab ? what are you testing ?

    Thanks
    Eldad

  17. mal says:

    why use # in the password, infact why use any special characters on a test VM??? very frustrating with the wrong keyboard map!!! Off to find another VM!

    • Jason Fenech says:

      I came across the same issue when trying to input both the # and @ characters. The workaround is to use the ALT-ascii code trick i.e. while holding down the ALT key, type in the decimal code for @ and # which are 64 and 35 respectively.

      so it’s;

      Password123!

      Cheers to the author. Saved me some time.

  18. matanyahu says:

    Hi Mike,

    I was recently going through your post as I was looking for a small distro with VM tools support. Eventually I made one myself which is based on TinyCore and has a very small footprint (48MB RAM, 64MB HDD, 19MB when thin-provisioned). You may want to take a look at it here: https://cloudarchitectblog.wordpress.com/2015/11/11/yvm-download-page/

  19. […] can follow a guide by Mike Brown how to install it to the hard drive (you have to use IDE otherwise the hard disk is not […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s