Archivo

Archive for febrero 2012

Migrating from VMware Server to VirtualBox

22 febrero 2012 Deja un comentario

Fuente: http://nerdbynature.de/s9y/?186

Even though VMware Server was working fine with Ubuntu 10.04 (apart from random lockups without a backtrace in sight to debug with), I was kinda unhappy with all the hoops one has to go through just to get a virtual machine going. The kernel modules might break on the next upgrade and are tainting the kernel unnecessarily. Fortunately today we have a few virtualization options to pick from and I chose VirtualBoxfor this particular setup, as it seemed to be the easiest migration path. Let’s begin with installing the prerequisites:

# apt-get install virtualbox-ose virtualbox-ose-dkms qemu

Then we had to convert our 2GB-split VMware VMDK files into a single VMDK file, otherwise qemu-bin would produce empty rawfiles in the 2nd step:

# vmware-vdiskmanager -r orig/test.vmdk -t 2 test.vmdk
# qemu-img convert -O raw test-flat.vmdk test.raw

# VBoxManage convertfromraw test.raw test.vdi
Converting from raw image file="test.raw" to file="test.vdi"...
Creating dynamic image with size 2147483648 bytes (2048MB)...

# ls -lgo *vmdk *raw *vdi
-rw------- 1 2147483648 2010-06-05 18:17 test-flat.vmdk
-rw-r--r-- 1 2147483648 2010-06-05 18:28 test.raw
-rw------- 1 1676681728 2010-06-06 12:50 test.vdi
-rw------- 1        432 2010-06-05 18:17 test.vmdk

Somehow VBoxManage cannot convert VMDK images directly, hence the qemu-img step. All these conversions will take a while, depending on image-size and diskspeed. There’s no progress-bar, so just be patient. With our VDIimage now in place, we can register it to VirtualBox:

# VBoxManage openmedium disk test.vdi
# VBoxManage list hdds
UUID:       ddaaf826-3d25-48d6-9b2a-1afefdd3350f
Format:     VDI
Location:   /data/vbox-vm/test/test.vdi
Accessible: yes
Type:       normal

Now for the actual virtual machine creation. It’s important to create the new machine with the same/similar hardware as the initial VMware instance was configured with, so that the guest OS won’t be too suprised about the «new» hardware, i.e. storage- or network-controllers.

# VBoxManage createvm --ostype Debian --register --name "test" \
   --basefolder `pwd`
# VBoxManage modifyvm test --memory 128 --audio none \
   --boot1 disk --clipboard disabled
# VBoxManage modifyvm test --pae off --hwvirtex off \
  --hwvirtexexcl off --nestedpaging off --vtxvpid off
# VBoxManage modifyvm test --nic1 bridged --bridgeadapter1 eth1 \
  --nictype1 Am79C970A --macaddress1 000c291ac243

I’ve disabled any kind of hardware virtualization features, as the host-CPU is too old and doesn’t support it anyway. Also, I used the MAC address of the VMware VM, so that the guest-OS will (hopefully) receive its known DHCP address. Now for the storage devices. Again, try to use the same controller as configured in the VMware server (see the .vmxfile of the old VMware instance). Also, we’re attaching the virtual harddisk from above to our virtual machine.

# VBoxManage storagectl test --name "SCSI Controller" \
   --add scsi --controller LsiLogic
# VBoxManage storageattach test --storagectl "SCSI Controller" \
   --port 0 --device 0 --type hdd --medium ddaaf826-3d25-48d6-9b2a-1afefdd3350f

Having done that, it should look like this:

# VBoxManage list -l vms | egrep 'Control|MAC'
Storage Controller Name (0):            SCSI Controller
Storage Controller Type (0):            LsiLogic
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0):  16
Storage Controller Port Count (0):      16
SCSI Controller (0, 0): /data/vbox-vm/test/test.vdi 
        (UUID: ddaaf826-3d25-48d6-9b2a-1afefdd3350f)
NIC 1:           MAC: 000C291AC243, Attachment: Bridged Interface \
                    'eth1', Cable connected: on, Trace: off (file: none), \
                    Type: Am79C970A, Reported speed: 0 Mbps

Now our virtual machine should be able to start just fine:

# VBoxHeadless -s test

You probably want to remove the VMware tools from the guest (vmware-uninstall-tools.pl) and tweak your startscripts to start your VM during bootup. Oh, and if the machine just won't start up, we can still cheat and install the VirtualBox GUI:

# apt-get install virtualbox-ose-qt tightvncserver xfonts-base wm2

Update: Migrating a WindowsXM VM from VMware to Virtualbox was equally straightforward, but I could not get the NIC type right. Neither Am79C970A (PCnet-PCI II) nor Am79C973 (PCnet-FAST III) seemed equal to the VMware Accelerated AMD PCNet Adapter in VMware. So I had to use the VirtualBox GUI again, as VirtualBox OSE does not ship with RDP support to connect to. Also, the Ubuntu/Lucid version does not ship with VNC support, yet. Here are the commands for the WindowsXP VM again:

# VBoxManage createvm --ostype WindowsXP --register --name winxp --basefolder `pwd`
# qemu-img convert -O raw ../../vmware-vm/winxp/winxp-static-flat.vmdk winxp.raw
# VBoxManage convertfromraw winxp.raw winxp.vdi
# VBoxManage openmedium disk winxp.vdi
# VBoxManage modifyvm winxp --memory 256 --audio none --boot1 disk \
                     --clipboard disabled --pae off --hwvirtex off --hwvirtexexcl off \
                     --nestedpaging off --vtxvpid off --nic1 bridged \
                     --bridgeadapter1 eth1 --nictype1 Am79C970A \
                     --macaddress1 000c11b9c19c
# VBoxManage storagectl winxp --name "IDE Controller" --add ide --controller PIIX4
# VBoxManage storageattach winxp --storagectl "IDE Controller" --port 0 --device 0 \
                       --type hdd --medium a6723e4d-2caa-433d-91ec-f67238ff36a9
                Posted by christian                                   in bits                                                    at                 23:37                                                            | Comments (6)                                                                                                | Trackback (1)

 

Categorías: virtualización Etiquetas: , ,

Making a USB Bootable System

14 febrero 2012 Deja un comentario

Fuente:  http://www.smallboxadmin.com/?p=48

Making System Rescue CD bootable from a USB thumb drive is a convenient way to carry the Linux distribution.  The benefit of the USB drive is that it won’t get scratched, the downside is that not all systems can boot from a USB device, I problem I ran into recently.

There are several utilities to create bootable USB drives, but there is a utility specifically for System Rescue CD that makes the process simple and quick.  First download the System Rescue CD ISO image and the System Rescue CD USB installer for Windows from the System Rescue CD web site.  Then connect a USB drive, a minimum 512MB drive is needed, to your system.

Start the System Rescue CD USB installer and select the location of the downloaded System Rescue CD ISO image and USB drive letter (Figure 1).  Note that I used a freshly formatted USB drive with a label indicating the version of System Rescue CD.

Figure 1 – Installing to USB

To avoid the delay of selecting the keyboard type, check the Customize boot options check box and select the keyboard mapping from the drop down box.  Optionally select the Display settings to boot directly into the GUI instead of command line mode.  Click the Install button to begin the installation.

The progress of the installation will display in the text box at the bottom of the application (Figure 2) and will indicate when the process is complete.

Figure 2 – Completion of install

The USB drive is now bootable and ready for use in rescuing a failed system.

Resources:

 

 

 

Cómo resetear el password de una VM Windows o Linux en vSphere

 

Fuente: http://www.josepros.com/2012/02/como-resetear-el-password-de-una-vm.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+josepros%2FeoSG+%28El+Blog+de+Josep+Ros%29&utm_content=Google+Reader

Mi querido colega Erich Reyes (@erichreyes), de Monterey, México, me ha pasado por twitter este interesante procedimiento para resetear una contraseña de cualquier VM Windows o Linux que tengamos como VM en un entorno vSphere.
Ya sabéis, llegáis a un cliente y no tienen la password, porque el informático ha marchado y, cómo no, la documentación del entorno brilla por su ausencia.
Se trata de descargar la imagen ISO del software Kon que podéis localizar aquí:
http://digiex.net/downloads/download-center-2-0/applications/6498-kon-boot-v1-1-password-utility.html
Más información de Kon-Book aquí:
http://www.piotrbania.com/all/kon-boot/
Posteriormente basta con seguir este sencillo procedimiento:
http://thebackroomtech.com/2009/08/12/howto-reset-a-lost-vmware-guest-password/
Espero que os sea de utilidad!
Gracias Erich!!

Categorías: virtualización Etiquetas: , ,