monkeydust.net

the ramblings of a crazed IT administrator

Browsing Posts tagged VMware

Here is handy tool that is part of VMware Workstation, but isnt as well know as some features but can be a real timesaver!

Let’s say your working on a Virtual Machine however it is turned off but you quickly need to pull an important file from it to use or check something you would normally have to go through the process of booting the whole VM to get to the file which may not be desirable if it takes a while to boot the VM, or you dont have the spare RAM (maybe you already have another VM or two running).

Thankfully, VMware can save you some hassle as it includes a tool to map VMware virtual hard disks directly to to the host computer without needing to boot a Virtual Machine at all. To use this tool simply go to File > Map or Disconnect Virtual Disks and click on the Map option, then point it to the .vmdk virtual disk file and select the drive letter to map it to. When you click Ok the drive will load which can take a few seconds and then you will have the disk available to use.

An Example Virtual Disk being Mounted for use

An Example Virtual Disk being Mounted for use

There are however a couple of important limitations to note:

  • You can only mount partitions that are formatted FAT or NTFS (on Windows anyway), any non-FAT or NTFS partitions that exist in a Virtual Disk won’t be mounted.
  • You can’t mount a Virtual Disk that is compressed, encrypted or set to have read-only permissions.
  • To run the Virtual Machine that uses a mounted Virtual Disk, you must first disconnect the disk via the Map or Disconnect Virtual Disks menu.

Finally, here is a final warning that I have taken from the VMware Manual that is worth reading if you make use of snapshots (either linked or un-linked ones):

Caution VMware recommends that you leave the check box “Open file in read-only mode” selected in the Map a Virtual Disk dialog box. This setting prevents you from accidentally writing data to a virtual disk that might be the parent of a snapshot or linked clone. Writing to such a disk might make the snapshot or clone unusable.

  • Share/Bookmark

One of my favourite features in VMware Workstation that I have found recently is the ability to create a ‘team’ of virtual machines. What this does is allow you to have one or more virtual machines running on a virtual LAN, essentially allowing you to setup a private test network where you for example run test domain controllers or any network application and as long as you have the network setup correctly there is no way for anything to ‘leak’ out onto your production network.

Ive been using this to run a simple test network with two virtual machines to help develop and test a new Group Policy for our Windows 7 deployment later this year. In one virtual machine I have Windows Server 2003 running as a Domain Controller and as a Router/DHCP Server (this VM effectively becomes our virtual LAN’s gateway for internet access and so needs two network interfaces – one to connect to hosts network and gain internet access and the other to connect to the internal virtual LAN), and in the other I have Windows 7 setup as a member of the test domain.

Once you have your virtual machines ready to go we are ready to create our Team and add the virtual machines to it. In VMware go to File -> New -> Team to launch the New Team Wizard. Give the Team a name and decide where you want to store the configuration file then add the virtual machines you want in the Team (you can always add and remove virtual machines to and from Team at any point). Next you need to add at least one LAN Segment, this is basically the virtual LAN that will connect our Domain Controller to our Windows 7 virtual machine (any any other VM’s you add), you can has multiple segments, all with different network speeds if you want to simulate a larger, multi-site network but for our simple lab it is easiest to just use one segment. Finally you need to which network adaptor connects to which network (virtual or otherwise), this can be a confusing if you are not used to networking and VMware so here is a screenshot of my configuration that you can use as a base.

My VMware Team Network Configuration

My VMware Team Network Configuration

The important thing here is to make sure that one network adaptor of the Domain Controller is on the Virtual LAN with the Windows 7 VM (and that if you have already run the network setup wizard after installing the network router/DHCP roles on the Domain Controller you make sure you select the correct adaptor – dont worry, it can always be changed if you get it wrong). Also, assuming you want all the machines in your Team to be able to access the internet then you will need to map the Internet facing adaptor on your Domain Controller to the host machines network, my recommendation is to use NAT here to ensure your Virtual Network remains isolated although aslong as you are careful when you configure the Domain Controller’s routing you can use Bridged networking.

And there we go, you should now have a simple, but very useful Virtual lab environment that you can use like me to test new Group Policy options, or really anything (ive been running the new Sharepoint 2010 beta in another test network), you can even extend the lab with additional LAN Segments to represent remote sites (with simulated packet loss too if you want), the Team options give you a lot of options if you want to expand your lab, the only limitation is how fast your computer is!

  • Share/Bookmark
Get Adobe Flash playerPlugin by wpburn.com wordpress themes