Kernel Development on Virtual Box Using a vdi disk image (ANU COMP3300/6330 students)

Editing Kernel Development on Virtual Box Using a vdi disk image (ANU COMP3300/6330 students)
To do this log into a lab computer and using the command line you should be able to copy it directly from "/dept/dcs/comp3300/supr/public/comp3300v2.vdi.bz2" into /scratch or a flash drive. It is big (2GB) so don't store it in your class account or use your class account as a staging area. Also don't use the file manager to copy the file as the file manager may also create a copy of the file in your class account.
 * Install and run Virtual Box.
 * Down load the Virtual Hard Disk from the classes public account.

It is also possible to use scp to copy it to one of your network connected computers. So from your home computer do something like: scp u1234567@partch.anu.edu.au:/dept/dcs/comp3300/supr/public/comp3300v2.vdi.bz2. Remember it is big. bunzip2 comp3300v2.vdi.bz2 Make a new virtual box using the wizard: with Operating System type: Linux Version: Ubuntu Base Memory Size: 1024MB Start-up Disk: Use existing hard disk point it to the comp3300v2.vdi Create
 * Uncompress the virtual hard disk.
 * Install Linux within a Virtual Box. In this example I have used:

Trick - the wizard places the virtual hard disk under a SATA Controler (at least on the version of VirtualBox I am running) remove the virtual hard disk from there and add the hard disk under the IDE Controller.

and do the following to test out your modified kernel: cd /usr/src/linux-source-2.6.32 make sudo make install sudo make modules_install sudo grub-install /dev/sda sudo update-grub sudo reboot now
 * Run the Virtual Box.
 * The user account is "os" and the password is also "os".
 * The linux source code is in /usr/src. This has already been compiled so modify the kernel source as you see fit

Transferring files to and from Virtual Box
A simple way of transferring files to and from the OS running on your virtual box is to use scp from within the OS running on virtual box. So to copy a file from virtual box to your class account from a terminal on the virtual box OS run: scp filename u1234567@partch.anu.edu.au:

To copy a file from your class account to the virtual box from a terminal on the virtual box OS run: scp u1234567@partch.anu.edu.au:filename.

Also you can obtain files directly from the web using firefox or wget. e.g. to obtain the hello kernel module from within a terminal on the virtual box run: wget http://cs.anu.edu.au/student/comp3300/labs/hello_module.tar.gz

One way of copying files from your host machine to the VBLOS (Virtual Box Linux OS) is to set up an ssh server within the VBLOS. To do this first enable a bridged network adaptor in the network settings (this is in-addition to the NAT network adaptor). This also requires an ssh server to be installed and running on the VBLOS. This has been done in the comp3300v2.vdi hard disk. If you are running from the comp3300.vdi then you will need to install the ssh server. This can be done by running the following on a VBLOS: sudo apt-get install openssh-server From VBLOS run: ifconfig This will tell you the IP address of the server you can use from the host machine (my one is 192.168.42.107). You should now be able to ssh into VBLOS from the host. ssh os@192.168.42.107 or transfer files to and from the host: scp filename os@192.168.42.107: