Knowing how to install an OS such as Windows XP, Windows Server or Linux from a CD in VMware ESX or ESXi is key...
to getting an OS and its applications onto a new guest virtual machine (VM). For those of us who have used server and desktop virtualization applications for years, these methods may be old hat, but they are quite a conundrum for new virtualization users.
To further confuse the issue, there are five options for installing VM guests that include loading media from a CD or DVD onto a new virtual server as well as the best method: creating ISO images of each OS and application you use frequently and hosting the ISO on a storage area network (SAN). This method is optimum because it's faster than copying the same data from a client device and sending it over the network to the desired guest virtual machine.
Option one: Physically insert media into server's CD/DVD drive (host device)
Although this is the least popular method, you can physically go to your ESX/ESXi Server with your CD/DVD media and insert your media into the server. This is the least popular method because VMware ESX servers often reside in a data center somewhere and not in an administrator's office next to your desk. (That said, if you're testing VMware ESX or you work for a small or medium-sized business, the ESX server may sit right next to your desk or in the next room.)
The first (and obvious) requirement for this method is to have physical access to the ESX host. You insert your media into the ESX host and open the VMware Infrastructure Client (VI Client). In the VI Client, you would go to edit the VM guest's CD/DVD drive and select the host device drop-down menu. You would then likely select /dev/scd0 for the first CD/DVD drive on your host. Also, note that the device needs to be connected, and connected at power-on (which we will discuss more later).
Option two: Linking a client device to your VMware Infrastructure Client computer CD/DVD drive
You can choose to connect your physical CD/DVD drive on your VMware Infrastructure Client (VI Client) computer to the ESX host by selecting Client Device when editing the properties for the VM guest.
Once you select a client device, you can use either a local CD/DVD drive on your desktop/laptop PC running the VI client or an ISO (or disk) image of that CD/DVD (later in this tip, I will discuss ISO images).
To do so, you need to go to use the Connect CD/DVD button that shows up only when you select the guest VM, and when the client device is selected for the CD/DVD drive. You'll see a picture of what the button looks like below.It can be found in the regular VI Client and if you do a pop-up console for that guest VM.
Notice how you can connect to any of the local physical CD/DVD drives on your PC. Or, as I'll discuss in option three, you can connect a local ISO file on your PC.
In general, using client devices (as in options two and three) are slow, because the CD/DVD will be on your local computer and the data (such as the entire Windows Vista OS) will be sent over the network to the guest VM. Thus, I discourage the use of client devices in favor of data store ISO files.
Option three: Client device mapped to an ISO file on client PC
Option three is the same as option two, except you connect an ISO file that is the CD/DVD that you want to map to the server. Of course, this ISO file resides on your local client PC.
I always prefer ISO "soft media" to "hard/physical media" just because you don't need to insert a physical CD/DVD. Physical media are prone to errors and scratches, and a drive can go bad. A ton of ISO files can be stored on a single hard drive and connected whenever needed. Still, as I mentioned in option three, the client-to-guest VM connection is slow because it has to transfer the necessary pieces of the ISO file across the network.
Option four: Data store ISO file on the local ESX host
Having an ISO file on the physical ESX host is the fastest way to get an OS installed on a guest VM (or for whatever reason you need a CD/DVD drive on a guest VM). To do so, you edit the guest VM's CD/DVD Drive and select data store ISO file, as depicted in the image below.
Note that you likely have multiple choices. Your local data store should have the name of the server in it (as circled below) or you can choose vmimages, which is a local folder to the server. The other options may be other data stores on the server or SAN storage.
Option five: Data store ISO file on a SAN
Of course, most admins use VMware with a storage area network because it is the most efficient way to store a data center's data and because it enables advanced VMware features.
Assuming you have a SAN and all ESX hosts are attached to it, why not do what I have done and create an ISO library on the SAN? This way, there is a single repository for all your OS images and application install CD/DVD media.
In my case, my iSCSI SAN is called [iSCSI-VMFS]. If I select data store ISO file and browse to the ISO library on my SAN , I have many OSes and applications to choose from, as shown below.
As you can see in the image below, I have mapped my CD/DVD drive to an ISO image on the iSCSI SAN.
If you are unfamiliar with creating ISO images, just how do you create these images of your CD/DVDs? Let's find out.
How to create ISO files from media for use with VMware ESX/ESXi
These methods can come in handy, but if you don't know how to create and ISO image, this tip leaves you in the dust. Not to worry. Creating an ISO image from a CD or DVD is easy. I use a free program called LC ISO Creator. There is no installation and the ZIP download is only 14 Kb. Just put your CD or DVD in the drive, run the program, select your CD/DVD drive and click Create ISO. You will be asked for the file name. After a few minutes, your ISO will be ready.
I recommend creating an ISO for each OS and major application that you use in your virtual infrastructure
How to transfer files to a VMware ESX/ESXi server
You've now created the ISO files, but how do you get them to your VMware Server? You have a couple of options.
- Use secure copy protocol
VMware ESX supports the Secure Copy Protocol (SCP). To use it, you want to get a SCP client such as WinSCP, PuTTY, or the popular FastSCP from Veeam. You can also use VM Explorer (for more information, see Backing up and managing VMware ESX virtual machines with VM Explorer).
- Use the VI Client data store browser
VMware allows you to transfer files to and from the proprietary VMware Virtual Machine File System (VMFS). To do this, open the VI Client. Click on the ESX host that you will want to use the ISO file with. Click on the Summary tab, then click on the data store that you plan to use.
From here, click the Upload button, then upload your ISO image.
It's that easy!
Importance of "connected" devices and "connected at power-on"
As a final note on connected and connected at power on devices, look at the figure below. Notice the CD/DVD Device status as being connected or connected at power-on. For a new VM guest to boot from any CD/DVD or CD/DVD image or device, that image or device must be connected at power-on. If you insert a new virtual CD/DVD while the machine is powered on, you don't care about Connected at Power On but you do care about it being connected.
Remember, to use your virtual CD/DVD devices, they must be connected.
ABOUT THE AUTHOR: David Davis (CCIE #9369, VCP, CWNA, MCSE, CISSP, Linux+, CEH) is the director of infrastructure at Train Signal Inc. He has written hundreds of articles and six video training courses, including the Train Signal VMware ESX Server video training series. His websites are Happy Router.com and VMwareVideos.com.