[Linux] Ubuntu Root Server to VMWare BareMetal Recovery

I got an root server on the net hosting an important website and am doing backups on a daily base using Tartarus ( http://wiki.hetzner.de/index.php/Tartarus_Backup-Konfiguration ). But as we all know: Backups are only worth a penny if they really work and are usable after an crash. Therefor I did try to recover the "dead called" machine onto BareMetal - or at least BareAir - as it was an VMWare Machine I used.

PreWork:
- Creating VMware Machine with same background and partition structure
( 40 GB HDD: Swap, Root, Boot Partition )
- Install Ubuntu 10.04.2 LTS

Recovery:
- Boot with Linux Live CD
- mount /dev/sda2 (my Root Partition)
- Recover Tartarus Backup curl ftp://USER:PASS@YOURSERVER/home-20080411-1349.tar.bz2 | tar xpvj -C /mnt/restore
- mount /dev/sda1 (my Grub Partition) and maybe recover Tartarus Backup of the Partition (most likely that should be do more harm than good... so... maybe leave it 😉 )
- Check UUID of the Partitions with blkid
- Change blkid within /etc/fstab
- Reboot

Done... or most likely 😉

PS: Maybe you will need to remove /etc/udev/rules.d/70-net-persistent and reboot because of the broken Ethernet Card...

[ESXi4.1] Review

It has been sometime, but I still want to tell my experiences with ESXi 4.1.
In the beginning, I was very annoyed from the fact that you really need an 64 bit System and at least 2 Gigs of RAM.
But the rest just turned out fine, I have to admit.

Theres an upgrade path available, so you can upgrade your ESXi 3.5 Machine via an Upgrade to 4.1 without losing your Machines or the need to reinstall.
Actually - it worked, which did surprise myself in a good manner.

In Terms of Speed and Stabilty I did not recognize anything bad.
Especially the new features were downright awesome:
I just love the USB Virtualisation.
I really hit the top by plugin in an USB Videocard to my ESXi 4.1, and adding this Virtual Device to an Vmware Appliance: Awesome speed, had realtime video within my VM.
( I used it to virtualize a bunch of Servers, Firewalls, Routers, Asterisk and a Webcamserver... was really nice running ).

The only thing I really couldn't test and missed was the PCI Virtualization.
That feature *should* work - but you need some kind of state-of-the-Art Intel CPU / Board with Virtual I/O... and I had an old Tyan AMD Dual Core Board, only... ^^'.

So maybe sometime later.

But after all, I'm really happy with that System, I could migrate an running Windows XP Machine to the ESXi4U1 and the Converter was really doing alright...

[Player 3.0] VMware Player Network Config

To configure network you need the "Virtual Network Editor" Tool. It IS integrated within the Installer - but isn't unpacked (sadly). To get the vmnetcfg.exe you need to do following: Launch the installer with /e parameter: VMware-player-3.0.0-197124.exe /e .\extract. With this command, the complete install gets "unzipped" into the "extract" folder. Within this folder you will find the network.cab. And in this file, you find the vmnetcfg.exe. Copy it to the Program Files\VMware\VMware Player Folder.  Run the Program as Administrator.

And to add multiple bridged interfaces, do configure an interface in the VMware File vmx with following:

ethernet0.present = "TRUE"
ethernet0.virtualDev = "vmxnet"
ethernet0.startConnected = "TRUE"
ethernet0.connectionType = "custom"
ethernet0.vnet = "/dev/vmnet0"

[ESXi 3.5] ESXi 3.5 Update 5 Install CD with oem.tgz + ssh,ftp,rsync and wget (made easy)!

Hello,

It has been a while since I was really doing something new with VMWare, but as I had the need to install some new Servers, I also was looking for better ways on integrating oem.tgz and other features. For that, I stumbled upon an very cool and useful Linux Build Script for ESXi, made by the User Varazir. After this How To you're going to hold an ISO Installer with SSH, FTP, RSYNC, WGET and the Community Unified Driver Pack 1.1.0 oem.tgz in your Hands. Or an USB Stick with the same features - as Live Boot or Installer. Your choice.

Download:
VMware-VMvisor-InstallerCD-3.5.0_Update_5-207095.i386.iso: Vmware.com / ESXi 3.5 Download Section
Mkesxiiso.sh: http://varazir.mine.nu/esxi/
CommunityUnifiedDriverPack_v1.1.0_U3-123629.oem.gz: http://www.vm-help.com/esx/esx3i/Custom_oem.tgz/CommunityUnifiedDriverPack_v1.1.0_U3-123629.oem.gz

What you also need:
An english (!) speaking and recent Ubuntu Version with installed mkisofs.
You can use the VMWare Player for that ;-).

How To:
Copy all the files into the /tmp Folder of the Ubuntu Installation.
Rename the CommunityUnifiedDriverPack_v1.1.0_U3-123629.oem.gz to oem.tgz
Give chmod +x to the latest Mkesxiiso.sh (in my case: chmod +x mkesxiaio_3.9.1.sh).
Run sudo ./mkesxiaio_3.9.1.sh
Now the Script is going to walk you through the build of the ESXi System.

Thanks to Varazir and www.vm-help.com its finally very easy to build an custom system!

Addition: Add User to installed ESXi:
If you got an installed ESXi 3.5 and want to have an second User to use ssh and ftp instead of "root only", do this:
userdelete the old additional VMWare User you created. Create it a new with: useradd Username -M -d /
Wit that command you create the new user and put its root folder into "/" (root).
Problem why an normal user can't access ssh is, that VMWare does erase the home Folder on every boot.
You should also change the User Password on creation with passwd Username...

ESXi 3.5 on Dell Optiplex 745

- Exchange oem.tgz on root of ESXi 3.5 Install CD with new oem.tgz
- Install with CD with OEM Community Version or IC8 oem.tgz  (SATA on Normal Mode)
- Boot from Knoppix 5.1, copy OEM.tz onto hda5 / Hypervisor Partition  (SATA on  Legacy Mode)
- Boot, works!

Hints:
- Use UltraISO und BurnISO to modificiate / burn the stock ISO
- http://www.vm-help.com./esx/esx3i/customize_oem_tgz.php

Create a virtual machine from an ISO with VMWare Player

copyed from another Blog:

Posted on December 28, 2008 in: how to, software, tools|Jump To Comments

Yeah, you heard me no CD/DVD burning in here. VMWare player lacks the ability to create new virtual machines by it self, this problem can be overcomed by using third party solutions or a blank virtual machine. However one small feature found on VMWare Workstation still missing which is the ability to install the operating system from ISO without having to burn in it into a CD/DVD first. Mostly it’s about reducing recordable media waste.

You can download a blank virtual machine ready for installation from this link.

You might also find this article interesting : How to Create a virtual machine with VMWare Player
Install from ISO

In order to make the virtual machine boot from the ISO you need to first edit the configuration ending with .vmx in this case named virtualmachine.vmx.

Add the following line to the configuration file.

ide1:0.fileName = "locationofiso.iso"

Locate and change the following line.

ide1:0.deviceType = "cdrom-raw"

To.

ide1:0.deviceType = "cdrom-image"

Close and save the configuration file. Now start the virtual machine and proceed with the regular installation.

After the installation is done change the values back to.

ide1:0.fileName = "auto detect"

ide1:0.deviceType = "cdrom-raw"

Save and enjoy your virtual machine.

Last revised on 02/04/2009

Get Ethernetcard working again in Linux under ESXi

After installing Ubuntu Server on Vmware ESXi, I couldn't find a NIC:

sudo /etc/init.d/networking restart

* Reconfiguring network interfaces...
eth0: ERROR while getting interface flags: No such device
SIOCSIFADDR: No such device
eth0: ERROR while getting interface flags: No such device
SIOCSIFNETMASK: No such device
SIOCSIFBRDADDR: No such device
eth0: ERROR while getting interface flags: No such device
eth0: ERROR while getting interface flags: No such device
Failed to bring up eth0.

Problem is that the ethernet MAC addresses are cached.

To remove the cache values:

sudo rm /etc/udev/rules.d/70-persistent-net.rules

Reboot, and it should work.

Other NIC files:
* /etc/hosts - change ip address and hostnames
* /etc/hostname - change hostname
* /etc/network/interfaces - change ip address

Install Vmware Tools on Linux

Under Debian necessary:
apt-get install autoconf automake make psmisc gcc
apt-get install linux-headers-`uname -r` build-essential

Short:
tar -xzvf VMwareTools-######.tar.gz
cd vmware-tools-distrib
./vmware-install.pl
vmware-tools-config.pl

Long:
Viclient, Connect to VM
Menu "VM/Install VMware Tools"
Tools are mounted to Cdrom
mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
cd /mnt/cdrom
tar zxvf VMware-Tools-xxxxxx.tar.gz -C /opt/
cd /opt/vmware-tools-distrib
./vmware-install.pl

Eisfair von ESXi auf CF

- ESXi Export für Workstation / Player
- Erweitere Template mit VMXBuilder um IDE Festplatte, size minimum the SCSI HDD
(Vorsicht, IDE:0:0!, CD Laufwerk auf IDE:0:1 setzen!)
- Booted VM mit "Ultimate Boot CD", starte Tool "g4u" V1.17
- Kopiere SCSI Disk auf IDE Disk
- Editiere Template: Entferne SCSI HDD
- Boote mit "Ultimate Boot CD", DamnSmall Linux
- mount /dev/hda2
- sudo vi /etc/fstab: /dev/sda1 und /dev/sda2 auf /dev/hda1 und /dev/hda2 ändern
- umount
- boot

Bootloader
---------------------------------
---------------------------------

/etc/lilo.conf
---------------------------------
disk = /dev/hda
bios = 0x80
boot = /dev/hda
read-only
prompt
timeout = 50
vga = normal
image = /boot/kernel
root = /dev/hda2
label = eis
initrd = /boot/initrd.gz
append = "ide=nodma acpi=force"
---------------------------------

Anschließend "lilo -v"

- wenn Eisfair läuft, neustarten
- Boot auf CD Image Acronis Home
- Image erstellen und auf Netzlaufwerk speichern

Am neuen PC
- Installiere Eisfair auf dem neuen Datenträger / CF
- wenn Eisfair läuft, neustarten
- Boot auf CD Image Acronis Home
- Image von hda2 aus dem Netzlaufwerk wiederherstellen
- booten
- Anschließend "lilo -v"

fertig