How to create a virtual machine with VMware on Linux: Linux series

In this tip, Andrew Kutz teaches you how to create you first virtual machine for VMware Server on Linux, complete with screenshots.

In the last installment of this series, you learned how to install the VMware Server management user interface

for Linux. Now, I'll teach you how to create your first VMware virtual machine. Once the VMware Server Console is connected to the remote server, click the menu item labeled "File," then click "New" and then click "Virtual Machine." There is also a key combination to do this, which is CTRL-N. Alternatively the big button in the middle of the VMware Server Console Home screen can be used to create a new virtual machine (VM) as well.

A wizard will appear titled "New Virtual Machine Wizard." Click the"Next" button.

Select the "Custom" option and click "Next."

Select the appropriate guest operating system that this VM will run and select its version. In this case, it will be Microsoft Windows Server 2003 Standard Edition. Click "Next."

Choose a name for the VM. This will also automatically fill in the location of the VM. Click "Next."

Uncheck the box next to "Make this virtual machine private". This way, access to the VM will be granted based on the file permissions on the VM. Click "Next."

Even though it may be tempting to select two virtual processors from the get go, consider this: Windows Server 2003 cannot cope with having a processor removed. Windows Server 2000 could handle this, but for whatever reason, 2003 cannot. So, while it is trivial to add more resources (in this case a CPU) later to the VM, it will not be possible to remove the additional CPU if it is not being utilized.

Therefore, select "One" processor and click "Next."

Regardless of the fact that most servers today ship with a minimum of 1 G of memory, Windows Server 2003 will happily run on 384 M of memory,and to be safe, go ahead and select 512 M. If, later on, the server craves more RAM, then satiate its volatile lust by increasing the amount of allocated RAM. Click "Next."

Unless the VM needs to be on a private network or a NATd network, select "Use bridged networking." This guide will not discuss all the different types of network settings available in VMware Sever, but there will be guide sometime in the near future on advanced networking and VMware Server.

Click "Next."

The BusLogic adapter is there for legacy support. Select "LSI Logic" and click "Next."

Select "Create a new virtual disk" and click "Next." Select "SCSI" and click "Next."

Windows Server 2003 Standard installs fine in 6 G of space, so for the disk size, specify "6".

Now the question arises about whether or not to pre-allocate the space for the virtual hard disk image. If the server has 6 G free, then by all means allocate the space in advance. This will increase the performance of the VM. However, allocating the space in advance also means that the disk cannot be shrunk or defragmented later. Something to keep in mind.

It is also a good idea to split the disk into 2 G files by checking the box next to that option. This will make it easier to burn the VM's disk files to a DVD if need be, or even to transfer the files over the network. There is less chance for an error to occur when moving or copying smaller amounts of data.

Click "Next."

Name the disk file something mnemonic, like "%HOSTNAME%-system.vmdk" and click "Next."

Congratulations, the VM has been created!

File permissions
File permissions are of the utmost importance when it comes to VMware Server on Linux -- specifically the permissions on the VMs configuration file, the vmx file. A VMs vmx file is located at "/var/lib/vmware/vms/VM_NAME/VM_NAME.vmx". There are two areas where the permissions on this file come into play. They are user access and process ownership.

User access
What level of access a user has to a VM depends on the file permissions that are set on the VM's vmx file. Here is a list of possible file permissions and their effects:

rwx - A user has full control of this VM, and they will also be able to log into the VMware Server MUI.

r-x - A user can control a VM's power states (on/off/suspend), and they will also be able to log into the VMware Server MUI.

rw- - A user will be able to change a VM's configuration but will not able to alter its power states. A user without execute privileges on any VM will not be able to log into the VMware Server MUI.

A user will also only see VMs in the MUI that the user has access to.

Process ownership
If you install VMware Server on Windows, you get a bevy of options when selecting under what user account the process that hosts a VM runs. Not so when you install VMware Server on Linux. All VMs will run in the security context of the user that owns the VM's vmx file.

One security measure that you may wish to take is to create a dedicated, low-privileged user account to own all VM vmx files so that all vmx processes are owned by a low-privileged user.

Now it's time to install a guest operating system on your new VM.

About the author: Andrew Kutz is deeply embedded in the dark, dangerous world of virtualization. Andrew is an avid fan of .NET, open source, Terminal Services, coding and comics. He is a Microsoft Certified Solutions Developer (MCSD) and a SANS/GIAC Certified Windows Security Administrator (GCWN). Andrew graduated from the University of Texas at Austin with a BA in Ancient History and Classical Civilization and currently lives in Austin, TX with his wife Mandy and their two puppies, Lucy and CJ.

This was first published in October 2007

Dig deeper on VMware basics

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchServerVirtualization

SearchVirtualDesktop

SearchDataCenter

SearchCloudComputing

Close