How to increase the VMware drive size

From OWASP Live CD 2008

Jump to: navigation, search

Installing the OWASP Live CD to VMWare HD, v1.2

Note: Tested on VMware Workstation 6 and VMware Server 2.0

Contents

Create VM

  • Other Linux 2.6.x kernel, NAT network connection, disk size 3G, memory 512M
  • Note: 2G is the absolute minimum

Update to Boot from LiveCD ISO

  • Edit virtual machine settings -> CD-ROM -> use ISO image -> browse to owasp-livecd-2008-Portugal
  • If needed when booting - hit F2 - to set Boot to CD-ROM Drive
  • When OWASP Live CD boot menu is displayed - hit return to boot into SLAX graphics mode

Prepare VMWare HD

  • The HD is called /dev/sda
  • fdisk and partition /dev/sda in a terminal
    • For a 3 GB drive, the commands are (press enter where commas are)

fdisk /dev/sda, n, p, 1, [enter] 328, n, p, 2, [enter] [enter], w [enter]

  • Run the following commands in a terminal as root:
 mkfs.ext3 /dev/sda1
 mkswap /dev/sda2
 mkdir /mnt/sda1   
 mount /dev/sda1 /mnt/sda1

Download SLAX installer and run it

  • slax6-install.kmdr can be downloaded from here:
    • Right-click, save page as slax6-install.kmdr.
    • Copies each directory from the CD to the HD
    • Creates HD's fstab
    • Runs lilo to install a boot loader
  • Run this script as "kmdr-executor slax6-install.kmdr" in a terminal
    • You should see "SLAX Live Installer" displayed
    • Default should be: "install SLAX to: /mnt/sda1" - set to /mnt/sda1 if not displayed
    • Default should be: "write MBR to /dev/sda" - set to /dev/sda if not displayed
    • Real (3500 MB required) should be selected
    • Click Install
    • This will take a couple of minutes - hit Close when complete as prompted
    • Remove the kmdr file from the desktop

Update the new inittab

  • On the new drive, update /mnt/sda/etc/inittab to start in runlevel 4
  • Change the line "id:3:initdefault:" to "id:4:initdefault:"

Check fstab

  • On the new drive, confirm that /mnt/etc/fstab looks like:
  /dev/sda / auto defaults 1 1
  devpts /dev/pts devpts gid=5,mode=620 0 0
  proc /proc proc defaults 0 0
  sysfs /sys sysfs defaults 0 0
  /dev/sda2 none swap sw 0 0
  • There may be an additional line for the virtual cdrom as well - that's ok

Shutdown & reboot from the new HD

  • shutdown -h now
  • update CD-ROM settings - Use physical drive
  • You will see the LILO Boot menu
    • After a few minutes, you'll see the OWASP Live CD 2008 wallpaper

Install VMWare Tools

  • VM -> Install VMware Tools
  • In the Live CD install, you will see the message "A new medium has been detected"
    • Select "Open in New Window"
  • Copy the .gz file to the desktop
  • Extract: tar zxf *.gz
  • cd vmware-tools-distrib
  • create directory /etc/pam.d (referred-to in the install)
  • ./vmware-install.pl
  • put vmware components in ./vmware subdirectory:
    • /usr/bin/vmware
    • init scripts are in /etc/rc.d (same as init directories)
    • daemon files in /usr/bin/sbin/vmware
    • library files in /usr/lib/vmware-tools
    • documentation files in /usr/bin/doc/vmware-tools
  • Installation will continue with configuration using /usr/bin/vmware-config-tools.pl
  • Take the defaults
  • Installation completes with starting the VMWare Tools services
  • You should be able to drag from your host desktop to SLAX desktop now
  • To start VMWare Tools services on boot update /etc/rc.d/rc.local to include:
    • /etc/rc.d/vmware-tools start
  • Clean up the vmware tools files from the Desktop

Increasing the partition size

[OPTIONAL]

  • Shutdown the OS if not already
  • Use VMware workstation/server's GUI to increase the hard drive size to what you'd like (e.g. 6 GB)
  • Update the VM to use the OWASP Live CD as a boot device and boot into the Live CD *NOT* the hard drive installation
  • After the Live CD boots up, open up a terminal window (konsole)
  • Unmount the current Linux partition "umount /dev/sda1"
  • Turn off the journal of that partition "tune2fs -O^has_journal /dev/sda1"
  • Turn off the swap partition with "swapoff /dev/sda2"
  • Run "fdisk /dev/sda" and do the following
    • print the current partition table
    • delete partition 1 & 2
    • create partition 1 (take old swap size from total size to get end of partition 1)
    • create partition 2 (from end of partition 1 to end of disk)
    • change the partition type of partition #2 to Linux Swap (82)
    • print the new partition table
    • write the new table
    • Watch out for the windows that pop up. Click cancel on both
  • Run "fsck -f /dev/sda1" (cya check)
  • Run "resize2fs /dev/sda1"
  • Run "fsck -n /dev/sda1" (more cya)
  • Run "tune2fs -j /dev/sda1"
  • Run "fsck -n /dev/sda1"
  • Create the new swap partition "mkswap /dev/sda2"
  • Reboot out of Live CD and make sure you take the Live CD out of the boot sequence (or move down)
  • Enjoy the new bigger virtutal hard drive
Personal tools