Monday, October 24, 2016

Installing an OS on a virtual machine in ESXi 5.5

Installing an OS on a virtual machine in ESXi 5.5

So now that I've installed ESXi and provisioned a virtual machine I need to figure out how to put an OS on the vm.

First thing is to get an image of the disc I want to install or download the image / .iso file.  Luckily microsoft has them up at all times, you just have to get a license key for them to bring them out of evaluation editions.  Since I already had a few .ISO files from microsoft we're moving onto step 2.

We need to put the iso file from my main computer onto the server.  We're going to click the server, not the virtual machine we've created since we want these .iso files to be accessible by more than just the one VM.


:Begin tangent

When ESXi was installed I installed the host OS onto my main hard drive raid array, This is a newbie mistake, however I am a noob to system administration.  Hopefully this helps explain why this is bad.  What would have been better was to do 1 of 2 things.
  1. Install ESXi onto a different usb flash drive. installed into a port usually directly on the motherboard.  This port is provided by Server motherboard manufacturers specifically for this purpose.  ESXi once loaded by the server will run in RAM and won't access the flash drive unless rebooting the entire host after changing host settings.
  2. Install ESXi directly onto the flash media you put the iso install file onto.  This is a nifty trick that allows you to basically load an OS onto the same drive you had the install files.  The install files themselves were only around 360 mb, And the lowest usb flash I ever find nowadays is 2 gig at minimum.  So this is more than possible.  However, I'm a newbie and am expecting to need to reinstall ESXi a few times just for learning purposes.  I also only picked up 1 usb drive so I needed to install this onto something else.
Now, why not just install directly onto the raid array.  Why not have it redundant with my raid 1+0 setup, faster access with my hard disks etc.  Warning: This answer is going to be based off things I've read, and not what I've experienced just yet.  


Basically, we've all gone through screwing up our home Operating system at least once and needed to format our home pc after we've backed up everything important.  Maybe we just wanted to upgrade our operating system.  The result was, formatting the drive, and installing everything from scratch.  Except now with a server we basically have everything backed up and standalone.  VMs that can be loaded on notice.  A multiple datastores of information that can be secured outside of a VM and used by multiple vm's as network shares.  The goal of the server is to basically have the ability to fix/adjust to issues/wants/etc faster by providing a separation of all these types of data so that its never tied down to 1 system. 

We've basically boxed ourselves into a corner that we can't reinstall the OS without some problems since it's on our main raid array.  Can it be done, I think so.  But its not something that I'm positive about just yet.

:End tangent

Ok now lets put an .iso someplace useful for our server's vms.
  1. We've clicked on the server 192.168.1.102.
  2. Click on the Configuration Tab, 
  3. Click Storage on the left of the tab.  This by default goes to Datastore view.




Right Click your datastore1 or whatever you've renamed it to and select browse datastore, wherever you're planning to put some files.




Create a directory for .ISO files. And then upload a file to this datastore.

*note you'll notice I created a vm directory before creating the vm, that was never able to be chosen during vm creation.  Creating the vm, created its own directory

Now that we've got our file somewhere the server and all our vms can access it.  We need to get the vm to boot looking at it.  

Right Click on your vm and goto Edit Settings, or if you're at the vm's Resource Allocation Tab, click Edit



Now we need to tell them vm 2 things.  
-It has a cd player
-The cd's contents are our .iso file from our datastore.
  1. The default settings tab that opens is Hardware, select hardware if you're not there.
  2. Click CD/DVD drive on the left.
  3. Check connect at power on, and check connected.
  4. Select Datastore ISO File.
  5. Browse to your Datastore iso file.



The connected checkbox actually allows you to add or remove cd's on the fly when your vm is running, Checking Connect at power On however is essential to boot an OS. To have it available during boot up.

Fantastic we're all done....or are we. DUN DUN DUNNNNN

If your vm refuses to boot off the cd, It might need to be reconfigured in the bios to boot off your cd ...so how does one get to the bios of a virtual machine.
  1. In the same VM Settings window, Click the options tab
  2. Click Boot Options down on the left side of the window
  3. Check The next time the virtual machine boots, force entry into the bios.
This will force the vm to go into a bios, where you can go find the boot sequence and make sure CD is above Hard drive and PXE



Now you should be ready to install an OS,

No comments:

Post a Comment