For a couple of years, I have been using Portable Ubuntu. This enables running Ubuntu Linux under Microsoft Windows. Thanks to Claudio Sanchez (@demonccc) who ported Ubuntu to CoLinux which is Windows based. I use it on several lab machines to perform testing. It is also portable as you can copy it onto a USB key and carry it with you and execute it from any Windows machine. Ideally, you would get a USB dongle of 8GB or more.
It is very easy to install. First, download Version_4 from the Portable Ubuntu Remix at Sourceforge.net. For example, file: Portable_Ubuntu_V4_slimLZM2_091311.exe
Then double click the executable file and it will unzip in its own folder. To start Portable Ubuntu, open the created folder and click on pubuntu.exe.
After a few seconds you should see a discrete application bar displaying at the top of your screen. You can hide it on the left or right hand side if you wish by clicking the left or right arrows on it.
Clicking on the Applications menu bar will display several application categories.
In the above window, I selected the Terminal app in which I ran the top command, here it is:
Now you must start feeling like home! From your Windows machine, start a command shell (cmd.exe) and you will be able to see the following processes, which represent your Portable Ubuntu environment. Use the 'tasklist' command:
pubuntu.exe 7772 Console 0 8,372 Ko
ccolinux-daemon.exe 8952 Console 0 7,376 Ko
colinux-console-nt.exe 8220 Console 0 2,848 Ko
colinux-slirp-net-daemon. 9776 Console 0 3,496 Ko
To terminate Portable Ubuntu, simply click the large red button on the Application bar or type sudo shutdown -h now from the CLI.
Now a few customization tricks:
By default, Portable Ubuntu's interface is NATed on your Windows machine's interface. Its default IP address is 10.0.2.15 and you can ping it from your Windows box. Here is an example:
pubuntu@pubuntu:~$ ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:ee:ff:33:d3:1c
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::2ff:75ff:fe39:d3c1/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10246 errors:0 dropped:0 overruns:0 frame:0
TX packets:15977 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1094200 (1.0 MB) TX bytes:12289522 (12.2 MB)
Interrupt:10
My WiFi adapter's IP address:
Ethernet Adapter WiFi Intel Advanced-N 6200 AGN:
DNS Suffix : sudo.com
Description . . . . . . . . . . . : Intel(R) Centrino(R) Advanced-N 6200 AGN
MAC Adress . . . . . . . . .: 00-00-11-22-33-11
IP Adress. . . . . . . . . . . . : 192.168.1.110
Subnet Mask. . . . . . : 255.255.255.0
Default Gateway. . . . . . : 192.168.1.1
DHCP Server. . . . . . . . . . . : 192.168.1.1
DNS Server . . . . . . . . . . : 192.168.1.1
Lease obtained . . . . . . . . . . . : December 12, 2011 18:44:41 PM
Lease expires. . . . . . . . . . : December 13, 2011 18:44:41 PM
Let's say that in your lab you wish to have a syslog server and an SSH server. By default, Portable Ubuntu has these two services enabled.
root 3657 1 0 21:01 ? 00:00:00 /usr/sbin/sshd -D
root 4283 1 0 21:01 ? 00:00:00 /usr/sbin/syslog-ng -p /var/run/syslog-ng.pid
pubuntu@pubuntu:~$ netstat -antu | grep -E ":22|:514"
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN
tcp6 0 0 :::22 :::* LISTEN
udp 0 0 0.0.0.0:514 0.0.0.0:*
Note: in the above example, syslog-ng is being used, which is superior to the basic syslogd. Please visit my Wiki for more info.
In order to access these services, you need to change the coLinux configuration file located under the config\portable_ubuntu.conf file. Make sure the following port redirection directive is configured under the line network_mode=slirp:
ports_to_redirect=tcp:22:22/udp:514:514
To make this effective, you have to stop/start Portable Ubuntu. Next, from your Windows machine, check whether ports TCP 22 and UDP 514 are available:
C:\>netstat -an | findstr ":22 :514"
TCP 0.0.0.0:22 0.0.0.0:0 LISTENING
UDP 0.0.0.0:514 *:*
You can now point your lab gear syslog to your Windows machine IP address and it will relay it to your Portable Ubuntu server. Idem for SSH, you need to ssh to your Windows box IP address in order to access your Pubuntu machine.
One last point, from Pubuntu, you can access your Windows machine files. Here is how to do it: change your directory to /media/cofs2. This takes you to your Windows root directory or C:\
Conclusion
If you need a Linux environment for your lab testing or even to practice LInux commands, then Portable Ubuntu is a great start. It is quite stable and even survives when my laptop resumes from sleep mode. Have fun!
Comments