VirtualBoxTestEnvironment

From BCCD 3.0

Jump to: navigation, search

Contents

GUI

VirtualBox Procedure for BCCD-ng

  1. Download/Configure Virtual Box.
  2. Download the latest bccd image.
  3. Download/Install the Virtual Box Extension Pack
    1. This enables PXE Booting through Virutal Box. If you want to PXE Boot, make sure to liberate the head node first
  4. Create a new virtual machine for 1 ... n different virtual nodes.
    1. Choose 'Linux' for Operating System
    2. For Version choose:
      1. 'Debian', if running 32 bit BCCD
      2. 'Debian (64 bit)', if running 64 bit BCCD (without this BCCD won't detect 64-bit hardware)
      3. Make a hard drive for the head node with the default of 8 GB to test liberation
  5. Point each VM's virtual CD/DVD drive to the image.
  6. Configure the internal network for the head node
    • Only the head node needs to connect to the Internet
    1. Choose Settings -> Network -> Adapter 2
    2. set 'attached to' to 'internal network'
    3. set the adapter to intel PRO/1000 MT Server
    4. set 'network name to 'bccd'
  7. Configure internal network for the rest of the nodes
    1. Choose Settings -> Network -> Adapter 1
    2. set 'attached to' to 'internal network'
    3. set the adapter to intel PRO/1000 MT Server
    4. set 'network name' to 'bccd'
    5. Now an internal network has been established between the virtual nodes.
  8. Start up each virtual machine, making sure that the head node gets a significant head start.
    • On the head node only, configure eth1 to ip 192.168.0.* (where * = a number between 1 and 255), subnet 255.255.255.0, no gateway
  9. Each client node should pick up an IP address automatically and not prompt for one.
  10. On the head node, run bccd-snarfhosts and cat ~/machines
    • Make sure there's an entry for each node you've attached

CLI

  1. Configure your NICs
    1. Figure out your public (bridged) NIC by examining the output of /sbin/ifconfig -a.
    2. Create a host-only interface in VirtualBox: VBoxManage hostonlyif create
    3. Modify the previously-created private (host-only) NIC with VBoxManage hostonlyif ipconfig vboxnet0 --ip 192.168.4.0 --netmask 255.255.255.0.
    4. Disable DHCP with VBoxManage dhcpserver remove --netname HostInterfaceNetworking-vboxnet0.
  2. Create your VM
    • VBoxManage createvm --name bccd-ng2 --ostype Debian_64 --register
  3. Attach a SATA controller
    • VBoxManage storagectl bccd-ng0 --name sata0 --add sata --controller IntelAHCI --portcount 4
  4. Create a hard disk image
    • VBoxManage createhd --filename ~/VirtualBox\ VMs/bccd-ng0/bccd-ng0.vdi --size 8192
  5. Attach the hard drive to the SATA controller
    • VBoxManage storageattach bccd-ng0 --storagectl sata0 --port 0 --device 0 --type hdd --medium ~/VirtualBox\ VMs/bccd-ng0/bccd-ng0.vdi
  6. Attach a DVD drive
    • VBoxManage storageattach bccd-ng0 --storagectl sata0 --port 1 --device 0 --type dvddrive --medium /cluster/bccd-ng/testing/bccd0_r2921.iso
  7. Modify the VM with VBoxManage modifyvm bccd-ng0 --memory 512 --acpi on --ioapic on --vtxvpid on --nestedpaging on --hwvirtex on --nic1 intnet --nictype1 82545EM --intnet1 bccd-ng0-net --nic2 nat --nictype2 82545EM --vrde on --vrdeaddress 127.0.0.1 --vrdeport 3901 --vrdeauthtype null --boot1 dvd --boot2 disk. (Make sure the intnet network name is unique for every BCCD network you want setup, and that you have the Extension Pack installed if you want to use the remote desktop)
  8. Forward SSH from localhost:2210: VBoxManage modifyvm bccd-ng0 --natpf2 "guestssh,tcp,,2210,,22"
  9. Create a ~/.ssh/config rule to login remotely:
     Host bccd-ng2
         User bccd
         HostName localhost
         ProxyCommand ssh tauon.cs.earlham.edu ssh hopper.cluster.earlham.edu ssh t-voc.cluster.earlham.edu nc %h %p
         Port 2210
    
  10. Create an association with the host-only NIC: VBoxManage modifyvm bccd-ng0 --nic2 hostonly --hostonlyadapter2 vboxnet0

Remote Management

You can use VRDP to manage the VMs remotely. Make sure you supply different ports for your VMs with --vrdpport. If you connect to the VM from Windows, you should be sure to supply a bogus username so that Windows doesn't screw things up with its credential caching.

Passing Boot Flags through VirtualBox's custom mac address

One can change VirtualBox's mac address via through the virutalbox gui or with the command

vboxmanage modifyvm <virtual machine name> --macaddress1 <new mac address written without ':'s> (ex. 020000000001)

The Custom MAC

To activate the BCCD's automatic test suite (not yet implemented), use the following format: 02:YY:YY:NI:OX:XX

Binary Boot Flags Encoded in Hexadecimal

The final three Xs represent 12 bits in which arbitrary boot flags may be set. Following are the positions of each bit within the 12 and their meanings.

There are plenty of websites available to help you convert your binary boot flag string to hexadecimal: One such website

Note: This configuration should be set only for the NIC that will handle the external network (if there is one) and the NIC that will handle the BCCD network. All boot flags besides the flags to match NICs to networks are taken from the BCCD Network NIC.

Troubleshooting

Machine folder path

If you get an error like this:
Runtime error opening '/cluster/home/skylar/VirtualBox VMs/bccd-ng2-0/bccd-ng2-0.vbox' for reading: -102(File not found.

You should make sure that the path to the machine folder is correct. In this case, it should be in /cluster/home2/skylar. It can be fixed by updating the machinefolder property: VBoxManage setproperty machinefolder /cluster/home2/skylar/VirtualBox\ VMs

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox