-

Cloning VMs on Linux Hosts with VMWare Server 2.0

Posted by aionman on Apr 16, 2010 in Ubuntu, VMWare

think it’s a MAJOR pain not having a “clone” feature in VMWare Server without using Virtual Infrastructure, so I made my own Linux shell scripts to do it.

The clone script does a straight clone of a VM. It copies the directory, renames the files and tweaks all the text inside the files by using sed to replace the old name with the new one, then sets all the permissions to what they would be if you created a new VM.

The rename script basically does all but copy it. This is handy for if you tried to rename a directory manually or attempted a manual copy and then found it still shows up under the old name in the web console. Remember this one assumes you have already renamed the directory to the new name and it MUST be the same as what you intend for the new name to be.

Both work the same way… scriptname <old name> <new name>

You can use quotes around the names if there are spaces, I went to great lengths to make sure it would still work with spaces in names (although I personally hate spaces).

Save the scripts to the base directory where your VM’s are, “standard” location is “/var/lib/vmware/Virtual Machines”. Make executable with chmod +x <scriptname>.

Once ran, add the new/renamed VM to the web console and choose “I copied it” or “I moved it” as appropriate.

These scripts are offered free to everyone to use, modify, or do anything else you want with except take credit for the original version. Absolutely no warranty or guarantee of any kind on the part of anyone that they won’t hose your VMs or even your whole system.

If I understand correctly how the split disks work, the 3rd file attached (clone-split-disk.sh) should work for those VM’s. I have not tested it myself and will likely not get a chance anytime soon, so I will rely on feedback from the community for any near-future tweaking. This is really just a change to one line (line 34) in the file – in the original we exclude the binary .vmdk file from parsing to find-and-replace since this is how single-disk-file versions are saved; in this version we exclude -f???.vmdk where “?” is a number between 0-9 (i.e. files like -f001.vmdk, -f002.vmdk, etc) while we parse the .vmdk file since with split disks, the .vmdk is a text file describing the -f???.vmdk binary disk files. IF you use a combination of split disks and single-file disks, probably neither one of these will work – maybe in a future version I will be able to merge the two scripts and add logic to tell the disk types apart.

clone_vm
change_name
clone-split-disk

 
-

VMWare – Guest cannot browse Internet

Posted by aionman on Apr 11, 2010 in Linux, VMWare

I think I figured it out. It isn’t related to SLlinux, nor to port 443, nor to VMWare and the FC5 port directly, but a combination of the Fedora port and VMware settings. It is related to the MTU setting consistancy between the virtual machine, FC5 and the site in question. For some reason the FC5 was set to 1492 and not 1500 as set under FC3. For this reason some of the HTTPS sites, I assume, require 1500 mtu. All I did was set Fedora’s eth0′s MTU setting to 1500 (ip link set eth0 mtu 1500) and it works fine. Weird. I could be wrong, but I think that was the problem. At least now it works. I got this hint from the guys at Fidelity. They thought it was unrelated, but apparently it is.

Maximum Transmission Unit(MTU), the largest physical packet size, measured in bytes, that a network can transmit. Any messages larger than the MTU are divided into smaller packets before being sent.By optimizing the MTU setting you can gain substantial network performance increases, especially when using dial-up modem connections.

Default MTU Size for Different Network Topology

Network MTU(Bytes)
16 Mbit/Sec Token Ring 17914
4 Mbits/Sec Token Ring 4464
FDDI 4352
Ethernet 1500
IEEE 802.3/802.2 1492
X.25 576

To change the MTU of an interface on GNU/Linux, you just need to use ifconfig command to do so, like this for example

sudo ifconfig eth0 mtu 1492

To change it permanently on Debian, put it in the /etc/network/interfaces file .where almost all network parameters are found. To do this, just add a line mtu to the definition of your interface and save the file.

sudo gedit /etc/network/interfaces

Example

iface eth0 inet static
address 192.168.0.1
network 192.168.0.0
gateway 192.168.0.254
netmask 255.255.255.0
mtu 1492

Daiup Users

For dialup users: the Maximum Transmission Unit (MTU) value can be changed within the file
/etc/ppp/options

Copyright © 2010 IT Support Blog All rights reserved. Theme by Laptop Geek.