VMware Cloud Community
taylorb
Hot Shot
Hot Shot
Jump to solution

Cloning Linux VMs

When cloning a linux VM or using a Linux VM as a template is there anything to watch out for? Do I need some linux equivalent of Sysprep on windows?

Reply
0 Kudos
1 Solution

Accepted Solutions
oreeh
Immortal
Immortal
Jump to solution

There isn't such an equivalent.

After cloning non-Windows VMs you have to adjust the settings (IP, hostname, ...) yourself.

View solution in original post

Reply
0 Kudos
8 Replies
oreeh
Immortal
Immortal
Jump to solution

There isn't such an equivalent.

After cloning non-Windows VMs you have to adjust the settings (IP, hostname, ...) yourself.

Reply
0 Kudos
mikepodoherty
Expert
Expert
Jump to solution

You can use the sys-unconfig command to remove host name, IP address, etc. I use it for my template servers in Solaris and the documentation in the man pages indicates that is should also work in Linux.

Reply
0 Kudos
virtualdud3
Expert
Expert
Jump to solution

I believe that, in some circumstances, you actually can customize a Linux guest:

Linux Requirements for Guest Customization

http://www.vmware.com/support/vc/doc/c1requirements.html#1041685

Guest customization of a Linux guest operating system can occur if:

The clone or template has one of the following Linux versions installed:

Red Hat Enterprise Linux AS 3.0

Red Hat Advanced Server 2.1

SUSE LINUX Enterprise Server 8

The clone or template has a root volume formatted with ext2 or ext3 file system.

Note: A default installation of SUSE LINUX Enterprise Server 8.0 formats the disk using the ReiserFS file system, which is not supported. If you would like to customize your SUSE virtual machines, be sure to format the disk using an ext2 or ext3 file system during the installation of the guest operating system.

The VMware Open Source Components installed on the VirtualCenter management server.

Refer to Installing the VMware Open Source Components for additional information.

http://www.vmware.com/download/vi/open_source.html

Note, I haven't used these, so I'm really not sure if it allows you to change the hostname/IP address. If Oliver says that it is not possible, I am inclined to believe him.

For what it is worth, I have found that, with Linux guests, it is easy-enough to just rely on kickstart installation script (with the desired options, IP address, hostname, etc.) instead of cloning and then monkeying-around with the customization. Just my $0.02 worth.

###############

If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!!!

############### Under no circumstances are you to award me any points. Thanks!!!
dwight
Enthusiast
Enthusiast
Jump to solution

Cloning Linux VMs works fine. Once they are cloned you may still need to configure them.

It's simplest to set up the base template to get it's configuration from the network. I.E. DHCP for network configuration, LDAP/NIS/NIS+ for accounts, automounter/nfs for shared directories (if needed), then if the host needs a static address and hostname that can be configured on the DHCP server. The rest can be configured from the network itself.

RHCE, VCP

RHCE, VCP Blog: http://computing.dwighthubbard.info
Reply
0 Kudos
oreeh
Immortal
Immortal
Jump to solution

To be honest I never tried the Linux guest customization since manually changing a hostname and an IP address isn't that "complicated".

With newer Linux distros you usually have to modify the network scripts anyway (due to the infamous MAC address hard coding).

Reply
0 Kudos
dwight
Enthusiast
Enthusiast
Jump to solution

Yeah, the Mac address issue in the network configuration files is a pain.

I've taken to removing the Mac address from the network configuration and setting it to DHCP before creating the template. I've found if I don't do that and someone else manually configures the VM I cloned for them they will set up their network configuration and forget to change the Mac address and call me wondering why their networking configuration doesn't seem to be working.

RHCE, VCP

RHCE, VCP Blog: http://computing.dwighthubbard.info
virtualdud3
Expert
Expert
Jump to solution

Yep, cloning Linux VMs works fine; I don't think there was ever a question about whether or not it is possible to clone Linux VMs.

I think the question was whether or not it is easier to clone, then configure, including changing/configuring IP, hostname, MAC tweaking, etc. etc. None of the previous configuration steps are very difficult; as I said before, I personally have found it easier/quicker to simply alter the appropriate lines in the ks.cfg (kickstart configuration file), and walk away while the installation proceeds.




###############

If you found this information useful, please consider awarding points for "Correct" or "Helpful". Thanks!!!

############### Under no circumstances are you to award me any points. Thanks!!!
Reply
0 Kudos
taylorb
Hot Shot
Hot Shot
Jump to solution

Thanks everyone, all very helpful comments.

Reply
0 Kudos