Today i decided to install Ubuntu again, but this time without using the wubi installer. So i was going to use a partition solely for linux.
It took me around 3 hours and here is the procedure for all of you...
Download latest Ubuntu Desktop LiveCD (8.04 beta was available when i did it). You can run it from the CD before installing it (that's what LiveCDs are all about), if you want to check for any problems (i unfortunately found some regarding my hard disks).
Please keep in mind that this Ubuntu version is still beta, so you shouldn't try it in a production environment. Also, wubi-installer is finally included officially with Ubuntu 8.04, something that could make you life easier, especially if you need more than just a trial run. So you have these 3 options:
1. Run the Ubuntu LiveCD
2. Install Ubuntu in your windows partition (through wubi)
3. Install Ubuntu in a different partition
For my CCIE preparation i used the 2nd option (you can read more details here); this time i'm using the 3rd one.
After you have tried the LiveCD and you have found and solved all booting problems, you can proceed and install Ubuntu in a free partition in your hard disk. I used a 30 GB partition for the root (/) partition and another 2 GB one for the swap partition (i could use a different one for /home too). You don't need to create them before the installation. The installation process can create them, as long as you have some free space (or a windows partition not needed).
Regarding my run/install problems, i had to add the "irqpoll" option to the boot options, because otherwise Ubuntu wouldn't recognize my SATA hard disks (i was getting "ata qc timeout" & "ata revalidation failed" messages). I guess it must be a problem having to do with the JMicron controller of the Abit IP35Pro motherboard (i searched the linux kernel bugs and i found many cases about it). I also removed the "quiet" and "splash" options from the boot parameters line, because i wanted to watch the whole boot process (i don't like things happening behind my back).
You can use the F6 key before installing (or the grub menu options after Ubuntu has been installed) in order to change the boot options. This is before booting/loading Ubuntu. There is a gui (search for "QGRUBEditor" in Synaptic) for changing permanently these options after you have installed/loaded Ubuntu (besides the obvious method of editing the "/boot/grub/menu.lst" file).
After Ubuntu has been installed and loaded correctly, make sure you have connectivity to the internet (i met some problems with my network setup -having ethernet adapters losing their ip addresses- and i had to run "ifdown eth1" & "ifup eth1"). Then run the Update Manager and install all the available updates (i found around 250).
Reboot and everything should be working fine at this time. If not, search for help in the Ubuntu forums, or try the stable 7.10 version. After all, you should already know that Linux is still harder to learn than Windows.
Ok, let's start the Dynamips/Dynagen installation now...
Open Synaptic Package Manager and search for "dynamips". You should find 2 packages : "dynamips 0.2.7-0.2.8RC2-1" & "dynagen 0.10.1-1" (or possibly a newer version of them). Install both of them (i suppose you know how to use Synaptic, or you can use "sudo apt-get").
Now you should have both packages correctly installed. If you run them through a terminal window, you should get the following output:
xxx@ubuntu:~$ dynamips
Cisco Router Simulation Platform (version 0.2.8-RC2-x86)
Copyright (c) 2005-2007 Christophe Fillot.
Build date: Nov 26 2007 06:40:51
Please specify an IOS image filename
Usage: dynamips [options]
xxx@ubuntu:~$ dynagen
Usage: dynagen [options]
xxx@ubuntu:~$ dynagen --version
dynagen 0.10.1.090807
I guess you already have some (already decompressed) IOS around (if it's compressed, try the "unzip -p" command). Otherwise you wouldn't mess with dynamips; would you? For my CCIE preparation i used latest 3640 & 3725 12.4 IOS; you can choose other if you like. Create a directory under /usr/share and put your IOS there. Of course you can choose another directory; i just liked the idea of sharing ;)
xxx@ubuntu:~$ sudo mkdir /usr/share/cisco-ios
You can always copy them from your windows directories (which get automatically mounted once you open them through the file browser/nautilus), like it was in my case (sda1, the 1st partition of my first sata hard disk, is drive letter C: in my windows):
xxx@ubuntu:~$ sudo cp "/media/sda1/Program Files/Dynamips/images/c3640-ik9o3s-mz.124-17a.extracted.bin" /usr/share/cisco-ios/
xxx@ubuntu:~$ sudo cp "/media/sda1/Program Files/Dynamips/images/c3725-adventerprisek9-mz.124-17a.extracted.bin" /usr/share/cisco-ios/
Now change the IOS file permissions and make them readable from everyone (you can always use more strict permissions, if you know how and why):
xxx@ubuntu:~$ sudo chmod 744 /usr/share/cisco-ios/*
xxx@ubuntu:~$ cd /usr/share/cisco-ios/
xxx@ubuntu:/usr/share/cisco-ios$
xxx@ubuntu:/usr/share/cisco-ios$ ls -al
total 144876
drwxr-xr-x 2 root root 4096 2008-03-29 17:52 .
drwxr-xr-x 286 root root 12288 2008-03-29 17:43 ..
-rwxr--r-- 1 root root 65954968 2008-03-29 17:50 c3640-ik9o3s-mz.124-17a.extracted.bin
-rwxr--r-- 1 root root 82221348 2008-03-29 17:52 c3725-adventerprisek9-mz.124-17a.extracted.bin
Create a new directory in your home folder, where you'll be storing your own labs. I like to use a folder on the Desktop, so i can very easily manage it (keep in mind that there are other ways too, if you want to put a folder on the desktop). Create another directory inside it, for your first lab. Also, inside each lab directory you'll need to create a working directory for all the "temporary" files (like nvram contents and ghost-ios files) used for your labs.
xxx@ubuntu:~$ cd Desktop/
xxx@ubuntu:~/Desktop$ mkdir cisco-labs
xxx@ubuntu:~/Desktop$ cd cisco-labs/
xxx@ubuntu:~/Desktop/cisco-labs$
xxx@ubuntu:~/Desktop/cisco-labs$ mkdir lab1
xxx@ubuntu:~/Desktop/cisco-labs$ cd lab1/
xxx@ubuntu:~/Desktop/cisco-labs/lab1$
xxx@ubuntu:~/Desktop/cisco-labs/lab1$ mkdir working
The directory structure should be like the following:
/home/xxx/Desktop/
/home/xxx/Desktop/cisco-labs/
/home/xxx/Desktop/cisco-labs/lab1/
/home/xxx/Desktop/cisco-labs/lab1/working/
/home/xxx/Desktop/cisco-labs/lab2/
/home/xxx/Desktop/cisco-labs/lab2/working/
and so on...
Create the following file ("lab1.net" is your test lab) using your favorite editor. I like vi, you can use gedit.
############
# Lab test
############
autostart = False
[localhost:7200]
# Don't forget to change this for every new lab
workingdir = /home/xxx/Desktop/cisco-labs/lab1/working
[[3640]]
# Specify 3640 IOS image on Linux here:
image = /usr/share/cisco-ios/c3640-ik9o3s-mz.124-17a.extracted.bin
#
ram = 128
disk0 = 0
disk1 = 0
# idlepc values are specific to each ios
idlepc = 0x605a5040
mmap = True
ghostios = True
sparsemem = true
[[Router R1]]
model = 3640
console = 2001
slot0 = NM-1FE-TX
F0/0 = SW1 F1/1
[[Router R2]]
model = 3640
console = 2002
slot0 = NM-1FE-TX
F0/0 = SW1 F1/2
[[Router SW1]]
model = 3640
console = 2007
slot1 = NM-16ESW
Now, while in lab1 directory, start dynamips in hypervisor mode and put it in the background (there is still no need to run it as root). Then press enter to see the shell prompt again.
xxx@ubuntu:~/Desktop/cisco-labs/lab1$ dynamips -H 7200 &
[1] 15052
xxx@ubuntu:~/Desktop/cisco-labs/lab1$ Cisco Router Simulation Platform (version 0.2.8-RC2-x86)
Copyright (c) 2005-2007 Christophe Fillot.
Build date: Nov 26 2007 06:40:51
Hypervisor TCP control server started (port 7200).
xxx@ubuntu:~/Desktop/cisco-labs/lab1$
Start dynagen with your first lab as a parameter:
xxx@ubuntu:~/Desktop/cisco-labs/lab1$ dynagen lab1.net
Reading configuration file...
Shutdown in progress...
Shutdown completed.
CPU0: carved JIT exec zone of 64 Mb into 2048 pages of 32 Kb.
NVRAM is empty, setting config register to 0x2142
C3600 instance 'ghost-c3640-ik9o3s-mz.124-17a.extracted.bin-localhost' (id 3):
VM Status : 0
RAM size : 128 Mb
NVRAM size : 128 Kb
Chassis : 3640
IOS image : /usr/share/cisco-ios/c3640-ik9o3s-mz.124-17a.extracted.bin
Loading ELF file '/usr/share/cisco-ios/c3640-ik9o3s-mz.124-17a.extracted.bin'...
ELF entry point: 0x80008000
C3600 'ghost-c3640-ik9o3s-mz.124-17a.extracted.bin-localhost': starting simulation (CPU0 PC=0xffffffffbfc00000), JIT enabled.
C3600 'ghost-c3640-ik9o3s-mz.124-17a.extracted.bin-localhost': stopping simulation.
Network successfully loaded
Dynagen management console for Dynamips
Copyright (c) 2005-2007 Greg Anuzelli
=>
Let's see the routers and the switches now:
=> list
Name Type State Server Console
R1 3640 stopped localhost:7200 2001
R2 3640 stopped localhost:7200 2002
SW1 3640 stopped localhost:7200 2007
Ok, let's start them:
=> start R1
CPU0: carved JIT exec zone of 64 Mb into 2048 pages of 32 Kb.
NVRAM is empty, setting config register to 0x2142
C3600 instance 'R1' (id 1):
VM Status : 0
RAM size : 128 Mb
NVRAM size : 128 Kb
Chassis : 3640
IOS image : /usr/share/cisco-ios/c3640-ik9o3s-mz.124-17a.extracted.bin
Loading ELF file '/usr/share/cisco-ios/c3640-ik9o3s-mz.124-17a.extracted.bin'...
ELF loading skipped, using a ghost RAM file.
ELF entry point: 0x80008000
C3600 'R1': starting simulation (CPU0 PC=0xffffffffbfc00000), JIT enabled.
100-VM 'R1' started
=> start R2
CPU0: carved JIT exec zone of 64 Mb into 2048 pages of 32 Kb.
NVRAM is empty, setting config register to 0x2142
C3600 instance 'R2' (id 2):
VM Status : 0
RAM size : 128 Mb
NVRAM size : 128 Kb
Chassis : 3640
IOS image : /usr/share/cisco-ios/c3640-ik9o3s-mz.124-17a.extracted.bin
Loading ELF file '/usr/share/cisco-ios/c3640-ik9o3s-mz.124-17a.extracted.bin'...
ELF loading skipped, using a ghost RAM file.
ELF entry point: 0x80008000
C3600 'R2': starting simulation (CPU0 PC=0xffffffffbfc00000), JIT enabled.
100-VM 'R2' started
=> start SW1
CPU0: carved JIT exec zone of 64 Mb into 2048 pages of 32 Kb.
NVRAM is empty, setting config register to 0x2142
C3600 instance 'SW1' (id 0):
VM Status : 0
RAM size : 128 Mb
NVRAM size : 128 Kb
Chassis : 3640
IOS image : /usr/share/cisco-ios/c3640-ik9o3s-mz.124-17a.extracted.bin
Loading ELF file '/usr/share/cisco-ios/c3640-ik9o3s-mz.124-17a.extracted.bin'...
ELF loading skipped, using a ghost RAM file.
ELF entry point: 0x80008000
C3600 'SW1': starting simulation (CPU0 PC=0xffffffffbfc00000), JIT enabled.
100-VM 'SW1' started
=> list
Name Type State Server Console
R1 3640 running localhost:7200 2001
R2 3640 running localhost:7200 2002
SW1 3640 running localhost:7200 2007
=>
Let's telnet to R2:
=> telnet R2
By default a new xterm window opens, with the following output:
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connected to Dynamips VM "R2" (ID 2, type c3600) - Console port
% Please answer 'yes' or 'no'.
Would you like to enter the initial configuration dialog? [yes/no]: n
Press RETURN to get started!
We repeat the same procedure for every router/switch and we're ready to start our configuration.
In case you need to change the telnet client used by dynagen, you can edit the appropriate line found in file " /etc/dynagen.ini":
# Uncomment below for Linux
telnet = xterm -T %d -e telnet %h %p > /dev/null 2>&1 &
After you have finished with your lab and want to exit dynagen and dynamips, you can do the following:
=> exit
Exiting...
Shutdown in progress...
Shutdown completed.
xxx@ubuntu:~/Desktop/cisco-labs/lab1$ pkill dynamips
xxx@ubuntu:~/Desktop/cisco-labs/lab1$
[1]+ Terminated dynamips -H 7200
This is it! You should now have a fully working dynamips environment under latest Ubuntu 8.04.