Minimal VirtualBox VRDP Setup - a quick guide

Discussion in 'Virtual and Cloud Computing' started by Jock_McTartan, Nov 10, 2007.

  1. Jock_McTartan

    Jock_McTartan Bit Poster

    15
    1
    8
    Been setting up a minimal VRDP server and thought I'd share....it's a work in porgress :)

    VRDP lets you run a headless server and access the VMs via RDP

    Minimal VirtualBox

    This is based on a minimal install of Debian Etch so first off download the Netinst iso – currently at:
    http://cdimage.debian.org/debian-cd/4.0_r1/i386/iso-cd/

    Install base system - when it prompts to add a mirror say no, reboot and login

    Edit /etc/apt/sources.list to add these lines
    Code:
    deb http://ftp.debian.org/debian etch main contrib
    deb-src http://ftp.debian.org/debian etch main contrib
    
    Run the following
    Code:
    apt-get update
    Add X (optional)

    Install X, WM and Desktop
    Code:
    apt-get install xserver-xorg-core xorg
    apt-get install gdm
    apt-get install fluxbox
    May be handy to install a browser:
    Code:
    apt-get install firefox
    Download VirtualBox
    Code:
    wget http://www.virtualbox.org/download/1.5.2/virtualbox_1.5.2-25433_Debian_etch_i386.deb
    Install it
    Code:
    dpkg -i virtualbox_1.5.2-25433_Debian_etch_i386.deb
    Fix the dependancy errors
    Code:
    apt-get install -f
    Once X is added Debs boots to it in all runlevels so we'll make our own console bootup
    Code:
    cd /etc/rc4.d/
    mv Sxxgdm to Kxxgdm
    Change the line in /etc/inittab to boot to init 4
    Code:
    id:4:initdefault
    As root add the user that will run the VM to vboxusers group
    Code:
    usermod -G vboxusers [your user]
    Check that /dev/vboxdrv has execute rights for vboxusers group

    The networking setup will vary depending on what you require - I wanted a seperate network for my VMs but still RDP from my main machine

    On my Windows box (where I will RDP from and not part of VM network) I set a secondary IP (eg 192.168.111.1)

    Reconfigure IP on VM box by editing
    /etc/network/interfaces

    Code:
    # The loopback network interface
    auto lo
    iface lo inet loopback
    auto eth0
    
    iface eth0 inet static
            address 192.168.111.2
            netmask 255.255.255.0
            broadcast 191.168.111.255
            gateway 192.168.111.1 
    
    Or at command line
    Code:
    ifconfig eth0 down
    ifconfig eth0 192.168.111.2 netmask 255.255.255.0 up
    
    Add route if needed (not necessary as want to be seperate)
    route add default gw 192.168.111.1

    I'm using ISOs stored on the server for installs purely for ease of use
    Bung the CD in the drive and do the following:
    Code:
    mount -t iso9660 /dev/cdrom /cdrom
    dd if=/dev/cdrom of=cd.iso
    
    Now create a VM and enable RDP – we will also change the listening port for each one created to allow you to run multiple VMs
    Code:
    VBoxManage createvm -name “Your VM” -register
    VBoxManage modifyvm “Your VM” -memory “128MB” -acpi on -boot1 dvd -nic1 intnet
    VBoxManage createvdi -filename “VM.vdi” -size 4000 -register
    VBoxManage modifyvm “Your VM” -hda “VM.vdi”
    VBoxManage registerimage dvd /full/path/to/iso.iso
    VBoxManage modifyvm “Your VM” -dvd /full/path/to/iso.iso
    VBoxManage modifyvm “Your VM” -vrdpport 3390
    VBoxVRDP -startvm “Your VM”
    
    Your VM will now be running - lets put it in the background to allow you to create some more
    Hit CTRL + Z and type
    Code:
    bg
    To bring it back use
    Code:
    fg
    To stop it running use
    Code:
    kill [PID]
    Now you should be able to connect to your VMs using a RDP client and the port you specified

    If using a Windows machine to RDp from tey this for a better response from RDP - edit the registry

    HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal Server Client
    Add a DWORD - Min Send Interval
    Value - 10

    Also you may have issues with the mouse pointer until the guestadditions have been installed :)

    Now add a SSH server so you can remotelly issue commands etc...

    Hope that's of some use to someone
     
    WIP: 70-270, Linux+

Share This Page

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.