Thursday, January 31, 2008

How To Configure OpenBSD 4.2 On VMWare ESX Server 3.5 With Intel PRO/1000MT NICs

Download your Virtual Machine .vmx file with your Datastore Broswer.
Edit your .vmx with WordPad.

Add
Ethernet0.virtualDev = "e1000"
Ethernet1.virtualDev = "e1000"

above
ethernet0.generatedAddress =
ethernet1.generatedAddress =


Save your .vmx and upload back into the datastore.
Start up your OpenBSD Virtual Machine.

Congrats! You now have Intel PRO/1000MT virtual nics on OpenBSD.


-----------------------------------
Have You Seen This Yet?
Get Crazy Good Mileage In Your Car.
You Have To Look At This!
http://www.wildmpg.com

ESX Server 3.5 - A general system error occurred: The file is too big for the filesystem

So there I was, trying to create an uber sized partition on my RAID 10 array within my vmfs3 partition.

The problem? A general system error occurred: The file is too big for the filesystem
This was the error I received when attempting to create a 600GB Virtual Disk on VMWare ESX Server 3.5.

This was a problem. I learned the reason why though. Since I partitioned the storage volumes during installation the installer used block size 1 which only allows Virtual Disks of 256GB.

The solution? Reformat the volume with larger block sizes.
Block size Max Virtual Disk size
1 256 GB
2 512 GB
4 1024 GB
8 2048 GB

Now I had to figure out how to do this without destroying my data.

My server has a 73GB Mirrored boot drive and 900GB of RAID 10. Fortunatly I had enough free space on the boot drive to transfer the data from the RAID 10 temporarily.

Logging into the console of the host I:
cd /vmfs/volumes/vh-01:storage1
Having previously taken note of the volume label and the device name of the volume I wished to modify, in my case vh-01:storage1 and vmhba1:1:0:1, I move the existing data out of Storage1 and into Storage2.
Use the Storage Browser to move your VMs
Next I ran the command to reformat Storage2
vmkfstools --createfs vmfs3 --blocksize 4M -S vh-01:storage1 vmhba1:1:0:1

I chose a 4MB blocksize because this volume will never exceed 1024MB.

Then I just moved the data back to Storage1.

How to install an OpenBSD 4.2 Bridging Firewall on VMWare ESX Server 3.5

Ok, I ran into some confusion on how to actually make my Virtual Transparent Bridging Firewall work on OpenBSD 4.2, but I finally got it to work.

For this example I will only show how to enable full inbound and outbound access through the bridge with PF, but I won't be inculding any other firewall rules.

I will assume that VMWare ESX 3.5 is already installed and the VMWare Infrastructure Client is also connected to the host.

There are some requirement to meet before we get started.

We will be using three Virtual Switches and two physical NICs.

Virtual Switch: vSwitch0 is bound to vmnic0 and only bound to the Service Console Port.
Virtual Switch: vSwitch1 is bound to vmnic1 and has a Virtual Machine Port Group named External Network assigned to it.
Virtual Switch: vSwitch2 has no NIC bound to it and has a Virtual Machine Port Group named Internal Network assigned to it.

The next step is very important.

On each of your Internal Network and External Network vSwitches click on Properties.
Click vSwitch and click Edit. Click the Security tab.
Set the Promiscuous Mode: field to Accept.
If this step hasn't been done then data will not pass between virtual switches.

Once the above has been done we can proceed with the installation of OpenBSD.

Create a new Virtual Machine with a 1GB disk.
Mount the OpenBSD 4.2 .iso any way you please and boot to it.
Reference the OpenBSD FAQ for more detailed install instruction.

Install to disk sd0.
Use all of disk for install.
Under the Disk Label:
Type: d a to delete any existing partition.
Type: a a to create a partition of 65M with the 4.2BSD FS Type and the mount point of /
Type: a b to create a partition of 1M with swap as the FS Type
Type: a d to create a partition of 256M with the 4.2BSD FS Type and the mount point of /var
Type: a e to create a partition of remaining size with the 4.2BSD FS Type and the mount point of /usr
Ok, Done with partitioning.

Set your hostname and domain name.
Create your password.
I added the bsd.mp package and removed the game42.tgz package from my installation.
To remove the game42.tgz package use the command: -game42.tgz during installation.

Since this is going to be an IPless firewall we will not start SSHD.

Set any other option you want and finish installing and reboot.

Login as root.

vi /etc/rc.conf
change sendmail_flags=NO
change inetd=NO
change pf=YES
Save /etc/rc.conf and exit

vi /etc/sysctl.conf
Enable kern.emul.freebsd=1
Save /etc/sysctl.conf and exit

Mount your VMWare FreeBSD Tools .iso
Make sure each of these commands are each on a single line.

mount /dev/cd0c /mnt

tar -xzf /mnt/vmware-freebsd-tools.tar.gz -C /tmp

mkdir -p /emul/freebsd/sbin

install -m 555 -o root -g wheel /tmp/vmware-tools-distrib/lib/sbin32/vmware-guestd /emul/freebsd/sbin

cp -r /tmp/vmware-tools-distrib/etc /etc/vmware-tools


vi /etc/rc.local
Add the following script.

if [ -x /emul/freebsd/sbin/vmware-guestd ]; then

echo -n ' vmware-tools'

/emul/freebsd/sbin/vmware-guestd --background /var/run/vmware-guestd.pid --halt-command "/sbin/shutdown -p -h now" --reboot-command "/sbin/shutdown -r now"

fi


vi /var/cron/tabs/root
Add ROOTBACKUP=0 underneath HOME/var/log
Comment out the sendmail line

Type the following command to create the bridge.

echo up > /etc/hostname.pcn0
echo up > /etc/hostname.pcn1

echo add pcn0 > /etc/bridgename.bridge0
echo add pcn1 >> /etc/bridgename.bridge0
echo blocknonip pcn0 >> /etc/bridgename.bridge0
echo blocknonip pcn1 >> /etc/bridgename.bridge0
echo up >> /etc/bridgename.bridge0

echo pass in all > /etc/pf.conf
echo pass out all >> /etc/pf.conf


Reboot!

You should now have a fully functioning bridge with VMWare tools installed. All that is left is to choose how you want to configure your firewall rules.


Note: I had some confusion as to whether or not to enable "net.inet.ip.forwarding" or not. I have finally discoved that it does not need to be enabled.

Monday, December 31, 2007

WOW Mount and Dismount Macro

MACRO 16777220 "Dismount" Ability_Mount_RidingHorse
/equipslot 13 Blad
/equipslot 8 Boots
/equipslot 3 Der
/equipslot 7 Mag
/equipslot 14 Rune of
/cast Aspect of the Viper
END



MACRO 16777226 "Mount" Ability_Mount_RidingHorse
/stopmacro [mounted]
/cast Aspect of the Monkey
/equipslot 13 Car
/equipslot 14 Fros
/equipslot 8 El
/equipslot 3 Dem
/equipslot 7 Stor
/use Swift Purple Hawkstrider
END

Friday, December 7, 2007

Installing Star-OS on a Virtual Machine (VMWare or MS Virtual Server)

So I thought it would be cool to install Star-OS on a Virtual Machine. I have done this on both VMWare Server and Microsoft Virtual Server R2. The process is similar. I am sure that VMWare Virtual Infrastructure 3 ESX Server will be a close match, but my license hasn't arrived yet.

This is how I did it.

1. Aquire Linux System Rescue CD, Live CD. I used systemrescuecd-x86-0.3.8.iso
2. Aquire Star-OS Compact Flash image. I used vncOs-1.3.7.v.fcc-2677.X86-PC.cf
3. Boot it all up and pat yourself on the back...Oh, you said we missed a step...ok, here we go.

Assuming you have bound your virtual NIC to your physical interface...
Mount your System Rescue cd and boot up your VM.
Since ifconfig shows no configured IP addresses yet run the command
dhcpcd eth0

Assign an IP manually if you don't use dhcp on your network.
Since my Star-OS image is on a network share, mount it up.
mount -t smbfs -o username=user,password=pass //nas-01/Volume_1 /mnt/custom

cd /mnt/custom

My virtual disk is IDE so I will use /dev/hda. Use /dev/sda if your virtual disk is SCSI.
Transfer the Star-OS image.
dd if=vncOs-1.3.7.v.fcc-2677.X86-PC.cf of=/dev/hda bs=512

Unmount your .iso from the Virtual Machine and reboot.
Log in to Star-OS. Default username/password is admin/1234

Saturday, November 17, 2007

World of Warcraft Hunter Aspect Macro

I bound the following macro to the SHIFT-W keystroke.
Cast Aspect of the Cheetah with shift-w.
Cast Aspect of the Hawk with shift-alt-w.
Cast Aspect of the Monkey with shift-ctrl-w


/cast [nomodifier] Aspect of the Cheetah
/cast [modifier:alt] Aspect of the Hawk
/cast [modifier:ctrl] Aspect of the Monkey

World of Warcraft Hunter Mounting Macro

Check it out. Cast Aspect of the Monkey, Equip Carrot on a Stick, Equip my riding boots with spurs attached, mount my ugly chicken.

When I dismount it equips my combat trinket and boots and casts Aspect of the Hawk.

I shortened the names of the items I am equiping to stay within the 255 character limit. It should not be a problem as long as there is not more than one item with the same short name.


/cast [nomounted] Aspect of the Monkey
/equipslot [nomounted] 13 Ca
/equipslot [nomounted] 8 El
/use [nomounted] Blue Hawkstrider
/equipslot [mounted] 13 Bla
/equipslot [mounted] 8 Su
/cast [mounted] Aspect of the Hawk