1. COOPERATIVE LINUX 1.1 INTRODUCTION ...coLinux requires the use of the TAP-Win32 virtual Ethernet...

20
1 | Page 1. COOPERATIVE LINUX 1.1 INTRODUCTION coLinux is a port of the standard Linux kernel with minimal changes. In other words, coLinux is the Linux kernel that's modified to run cooperatively with another operating system. For instance, it allows one to freely run Linux on Windows without using commercial PC virtualization software such as VMware, in a way which is much more optimal than using any general purpose PC virtualization software. Cooperative Linux utilizes the rather underused concept of a Cooperative Virtual Machine (CVM), in contrast to traditional VM’s that are unprivileged and being under the complete control of the host machine. 1.2 MORE ON COLINUX Cooperative Linux is a means to provide Linux services on a Linux or Windows host. CoLinux is not like a normal emulator or virtual machine (like VMware or Virtual box). A real Linux kernel will run on your system alongside Windows (or a host Linux). Fig.1 below shows Ubuntu (guest OS) running alongside Vista (host OS) and how Mozilla Firefox has been simultaneously accessed by them. This Ubuntu-Windows coLinux implementation is also popularly known as Portable Ubuntu. CoLinux is a system that consists of a Windows kernel driver, a Linux kernel and some userspace daemon programs. When the colinux-daemon.exe is started, it will parse the given config file, load the linux.sys (Windows) kernel driver and tell it to reserve the specified amount of RAM for the Linux system,the Pseudo Physical RAM (explained later). Then the daemon loads the Linux kernel in the reserved RAM area and starts it. The Linux kernel is a slightly modified version of the standard x86 kernel. It has been stripped of all parts that directly access the hardware. Instead the kernel uses (with the help of linux.sys) either defined APIs in the Windows kernel or user space programs to access needed resources like storage or network. The term Cooperative is used to describe two entities working in parallel, e.g. co routines. In that sense the plainest description of Cooperative Linux is turning two operating system kernels into two big co routines where each kernel has its own complete CPU context and address space, and each kernel decides when to give control back to its partner. However, only one of the two kernels has control on the physical hardware, where the other is provided only with virtual hardware abstraction.

Transcript of 1. COOPERATIVE LINUX 1.1 INTRODUCTION ...coLinux requires the use of the TAP-Win32 virtual Ethernet...

Page 1: 1. COOPERATIVE LINUX 1.1 INTRODUCTION ...coLinux requires the use of the TAP-Win32 virtual Ethernet adapter driver. TAP-Win32 allows processes running under a Windows server to access

1 | P a g e

1. COOPERATIVE LINUX

1.1 INTRODUCTION

coLinux is a port of the standard Linux kernel with minimal changes. In other words, coLinux is

the Linux kernel that's modified to run cooperatively with another operating system. For

instance, it allows one to freely run Linux on Windows without using commercial PC

virtualization software such as VMware, in a way which is much more optimal than using any

general purpose PC virtualization software. Cooperative Linux utilizes the rather underused

concept of a Cooperative Virtual Machine (CVM), in contrast to traditional VM’s that are

unprivileged and being under the complete control of the host machine.

1.2 MORE ON COLINUX

Cooperative Linux is a means to provide Linux services on a Linux or Windows host. CoLinux

is not like a normal emulator or virtual machine (like VMware or Virtual box). A real Linux

kernel will run on your system alongside Windows (or a host Linux). Fig.1 below shows Ubuntu

(guest OS) running alongside Vista (host OS) and how Mozilla Firefox has been simultaneously

accessed by them. This Ubuntu-Windows coLinux implementation is also popularly known as

Portable Ubuntu.

CoLinux is a system that consists of a Windows kernel driver, a Linux kernel and some

userspace daemon programs. When the colinux-daemon.exe is started, it will parse the given

config file, load the linux.sys (Windows) kernel driver and tell it to reserve the specified amount

of RAM for the Linux system,the Pseudo Physical RAM (explained later). Then the daemon

loads the Linux kernel in the reserved RAM area and starts it.

The Linux kernel is a slightly modified version of the standard x86 kernel. It has been stripped

of all parts that directly access the hardware. Instead the kernel uses (with the help of linux.sys)

either defined APIs in the Windows kernel or user space programs to access needed resources

like storage or network.

The term Cooperative is used to describe two entities working in parallel, e.g. co routines. In that

sense the plainest description of Cooperative Linux is turning two operating system kernels into

two big co routines where each kernel has its own complete CPU context and address space, and

each kernel decides when to give control back to its partner. However, only one of the two

kernels has control on the physical hardware, where the other is provided only with virtual

hardware abstraction.

Page 2: 1. COOPERATIVE LINUX 1.1 INTRODUCTION ...coLinux requires the use of the TAP-Win32 virtual Ethernet adapter driver. TAP-Win32 allows processes running under a Windows server to access

2 | P a g e

Fig 1: coLinux (Ubuntu running on Windows Vista)

1.3 SYSTEM REQUIREMENTS

CoLinux requires Windows 2000, XP, Vista or windows 7 in order to work. These NT-based

operating systems include support for asynchronous operations and include security features not

found in DOS-based versions of Windows. "Asynchronous operations" means that the computer

can work on new tasks while waiting for other tasks to complete rather than queuing tasks up.

1.3.1 NETWORK ACCESS

coLinux requires the use of the TAP-Win32 virtual Ethernet adapter driver. TAP-Win32 allows

processes running under a Windows server to access that Windows server as if it were accessing

it over the network and vice-versa. This probably brings some insight into how coLinux achieves

its capability of appearing to run as a separate computer.

1.3.2 RAM and DISK SPACE

A physical RAM of 64MB (which is the default) seemed enough for running Ubuntu 9.04

perfectly in CLI mode. Although as the Operating System is to be run along with several

processes (depending on the user), the RAM size can be easily increased as shown later in the

document.

As for the Disk space, a partition is required with a few GBs available. Since coLinux works

using disk images we can download of different sizes depending on the type of coLinux

distribution (Gentoo, debian etc.). I have used the image of Ubuntu 9.04 which amounts to 1 GB

of space when unzipped.

Page 3: 1. COOPERATIVE LINUX 1.1 INTRODUCTION ...coLinux requires the use of the TAP-Win32 virtual Ethernet adapter driver. TAP-Win32 allows processes running under a Windows server to access

3 | P a g e

1.3.3 GRAPHICAL CONSOLE TOOLS

coLinux requires additional tools to be installed in order for the graphical console to be accessed.

These tools include Cygwin and VNC, and also the desktop theme viz. KDE or gnome can also

be downloaded as per the users requirement. Apart from the above tools, there can be several

alternatives to it which is very elaborately explained in the colinux wiki site.

2. WORKING

coLinux is the Linux kernel that's modified to run cooperatively with another operating system.

The host operating system (Windows or Linux) maintains control of the physical resources of the

operating system, while the guest operating system (coLinux) is provided with a virtual

abstraction of the hardware. Hardware abstractions are sets of routines in software that emulate

some platform-specific details, giving programs direct access to the hardware resources.

Unlike in other Linux virtualization solutions such as User Mode Linux (VMware/Virtual Box),

a special driver software on the host operating system is used to execute the CoLinux kernel in a

privileged mode (known as ring 0 or supervisor mode). The special RING 0 approach in

Cooperative Linux makes it significantly different than traditional virtualization solutions such

as VMware, plex86, Virtual PC, and other methods such as Xen. All of these approaches work

by running the guest OS in a less privileged mode than of the host kernel.

Fig 2: Ring Architecture

Page 4: 1. COOPERATIVE LINUX 1.1 INTRODUCTION ...coLinux requires the use of the TAP-Win32 virtual Ethernet adapter driver. TAP-Win32 allows processes running under a Windows server to access

4 | P a g e

The root file system for coLinux is a regular file within the host operating system. To Windows

it's just a regular file, but to coLinux it's an ext3 file system that can be read and written to.

Other features needed by the Linux kernel, such as networking or video access, are provided

externally. Networking is made accessible to coLinux through a TUN/TAP driver. Access to the

display is also provided. X Window System is a protocol by which video output can be sent from

one host to another. Therefore, by using an X Window System server on the host operating

system, video output can be redirected to the available X server.

Fig 3: coLinux executes as a process of the host operating system

The following is an extract from the coLinux configuration file (colinux.conf):

# The default kernel

kernel=vmlinux

# File contains the root file system.

cobd0="c:\coLinux\Ubuntu-9.04.ext3.1gb.fs"

# Swap device, should be an empty file with 128..512MB.

cobd1="c:\coLinux\swap_device"

# This parameter will be forward to Linux kernel.

root=/dev/cobd0

# Additional kernel parameters (ro = rootfs mount read only)

ro

# Initrd installs modules into the root file system.

Page 5: 1. COOPERATIVE LINUX 1.1 INTRODUCTION ...coLinux requires the use of the TAP-Win32 virtual Ethernet adapter driver. TAP-Win32 allows processes running under a Windows server to access

5 | P a g e

# Need only on first boot.

initrd=initrd.gz

# Maximal memory for linux guest

mem=512

# Slirp for internet connection (outgoing)

eth0=slirp

# Tuntap as private network between guest and host on second linux device

eth1=tuntap

2.1 Device Driver:

The device driver port of Cooperative Linux is used for accessing kernel mode. When a coLinux

VM is created, the driver loads a kernel image from a vmlinux file that was compiled from the

patched kernel with CONFIG_COOPERATIVE.

kernel=vmlinux (As in the configuration file)

The same vmlinux file can be used to run a Cooperative Linux VM on several OSes of the same

architecture. The VM is associated with a per-process resource and if the process (colinux-

daemon.exe) running the VM ends abnormally in any way, all resources are cleaned up

automatically from a callback when the system frees the per-process resource.

2.2 Pseudo physical RAM:

On startup, Cooperative Linux is given a fixed set of physical pages, where it does the

translations needed for it to work transparently in that set. All the memory which Cooperative

Linux considers as physical is in that allocated set, which is called the Pseudo Physical RAM.

# Maximal memory for linux guest

mem=512

The above is the Pseudo physical RAM and is presently set to 512 MB. This is the line in the

configuration file which when parsed by the colinux-daemon.exe loads the linux.sys driver

which reserves the RAM for the coLinux. The linux kernel is then loaded in this reserved RAM

area.

2.3 Context Switching:

The Cooperative Linux VM uses only one host OS process in order to provide a context for itself

Page 6: 1. COOPERATIVE LINUX 1.1 INTRODUCTION ...coLinux requires the use of the TAP-Win32 virtual Ethernet adapter driver. TAP-Win32 allows processes running under a Windows server to access

6 | P a g e

and its processes. That one process, named colinux-daemon, can be called a Super Process since

it frequently calls the kernel driver to perform a context switch from the host kernel to the guest

Linux kernel and back. By frequently switching the machine's state between the host OS state

and the CoLinux kernel state, CoLinux is given full control of the physical machine's MMU (i.e.,

paging and protection) in its own specially allocated address space (the pseudo physical RAM),

and is able to act just like a native kernel, achieving almost the same performance and

functionality that can be expected from a regular Linux which could have ran on the same

machine standalone.

Control is returned to the host OS on every hardware interrupt.So, it is the responsibility of the

host OS scheduler to give time slices to the CooperativeLinux VM just as if it was a regular

process.

2.4 Interrupt Handling:

Since a complete MMU context switch also involves the interrupt descriptor table register

(IDTR), Cooperative Linux must set an interrupt vector table in order to handle the hardware

interrupts that occur in the system during its running state. However, Cooperative Linux only

forwards the invocations of interrupts to the host OS, because the latter needs to know about

these interrupts in order to keep functioning and support the colinux-daemon process itself,

regardless to the fact that external hardware interrupts are meaningless to the Cooperative Linux

virtual machine.

2.5 Hardware Virtualization:

To cooperatively share hardware with the host operating system, CoLinux does not access I/O

devices directly. Instead, it interfaces with emulated devices provided by the CoLinux drivers in

the host OS. For example, a regular file in Windows can be used as a block device in CoLinux.

All real hardware interrupts are transparently forwarded to the host OS, so this way the host OS's

control of the real hardware is not being disturbed and thus it continues to run smoothly.

2.6 SLIRP and TAP:

With Slirp, the coLinux OS can see other computers on the network, but no other computer can

see it directly, not even the Hosting OS. The coLinux monitor itself acts as a DHCP server,

granting the coLinux instance a private ip address and mediating all network communications.

"Outgoing calls" from the coLinux box work as expected. Slirp can be configured to forward a

port from the Host operating system to the Guest operating system. Other than this port

forwarding capability, the coLinux Guest is invisible to the network. Using Slirp port

forwarding, it is possible to ssh to the Guest, connect using vnc, etc. Port forwarding is not

required to run xclients like xterm.

Slirp acts as a DHCP server to the coLinux OS, which gets an IP address like 10.0.2.15. It can

ping 10.0.2.3, which is the coLinux monitor on the Hosting OS. The coLinux monitor forwards

Page 7: 1. COOPERATIVE LINUX 1.1 INTRODUCTION ...coLinux requires the use of the TAP-Win32 virtual Ethernet adapter driver. TAP-Win32 allows processes running under a Windows server to access

7 | P a g e

all network communications. Slirp is like having a firewall between the coLinux OS and the

coLinux Hosting OS. The coLinux monitor is the firewall. It permits outgoing, but not

unsolicited incoming traffic.

TAP is a virtual network adapter that installs on the Hosting OS. The coLinux OS network

adapter can then connect to this virtual network adapter. Windows sees the TAP virtual adapter

looks just like any other network adapter, and there are many possibilities: Private Connection to

Hosting OS, Windows Internet Connection Sharing or Windows Software Bridge.

After you create a virtual adapter on the Hosting OS with TAP, all the options of configuring a

real ethernet adapter are available. A common method is to use Windows Internet Connection

Sharing to share a network connection to a coLinux OS connected to a TAP virtual adapter.

3 CONFIGURATION

3.1 Install coLinux:

1. Download the coLinux installer file from http://sourceforge.net/projects/colinux/files/

2. For the OS images file, i downloaded the Ubuntu 9.04 version under “Ubuntu 2.6.x

Ubuntu”.

3. Run the coLinux installer:

Accept defaults except for:

Destination Folder: change it to c:\coLinux

You do not need to install WinPCap library. (Although i did it).

You might get a warning dialog saying that "TAP-Win32 Adapter V8 (coLinux)" has not passed Windows Logo testing. Click "Continue Anyway"

Page 8: 1. COOPERATIVE LINUX 1.1 INTRODUCTION ...coLinux requires the use of the TAP-Win32 virtual Ethernet adapter driver. TAP-Win32 allows processes running under a Windows server to access

8 | P a g e

Fig 4: Folder where coLinux was installed

3.2 Configure coLinux:

1. Copy Ubuntu-9.04-1gb to c:\coLinux. (Keep a copy of this file as a backup to revert your

Ubuntu filesystem if you mess things up.)

2. Decompress the Ubuntu file system image.

3. fsutil file createnew swap_device 536870912 (On windows, run cmd as administrator)

4. Create a configuration file

cmd> C:\colinux\ copy example.conf colinux.conf

5. Edit colinux.conf and set the following:

cmd> C:\colinux\ edit colinux.conf

cobd0="c:\coLinux\Ubuntu-9.04.ext3.1gb.fs"

cobd1="c:\coLinux\swap_device"

mem=512

eth0=slirp

eth1=tuntap # only needed for TAP connection

Page 9: 1. COOPERATIVE LINUX 1.1 INTRODUCTION ...coLinux requires the use of the TAP-Win32 virtual Ethernet adapter driver. TAP-Win32 allows processes running under a Windows server to access

9 | P a g e

The following items should already be set by default:

kernel=vmlinux

root=/dev/cobd0

ro

initrd=initrd.gz

3.3 Run coLinux:

1. Open a Windows cmd.exe shell

2. cd c:\colinux

3. colinux-daemon.exe -t nt @colinux.conf

(the -t nt is optional but makes it easier to copy/paste)

4. login as "root" with password "root"

5. Try commands such as ls, pwd, etc.

6. To exit, use the halt command.

3.4 Configure networking with SLIRP:

1. If you use a http proxy server to get to the internet, do the following inside the running

CoLinux session:

echo "export http_proxy='http://your-proxyserver.com:yourportnumber'"

>> .bash_profile

source .bash_profile

2. Otherwise, there is nothing to do. The Ubuntu image already has the correct /etc/network/interfaces and /etc/resolv.conf files setup.

3. The /etc/network/interfaces should look like this:

# This file describes the network interfaces available on your system

# and how to activate them. For more information, see interfaces(5).

Page 10: 1. COOPERATIVE LINUX 1.1 INTRODUCTION ...coLinux requires the use of the TAP-Win32 virtual Ethernet adapter driver. TAP-Win32 allows processes running under a Windows server to access

10 | P a g e

# The loopback network interface

auto lo

iface lo inet loopback

# The primary network interface (slirp)

auto eth0

iface eth0 inet static

address 10.0.2.15

broadcast 10.0.2.255

netmask 255.255.255.0

gateway 10.0.2.2

4. etc/resolv.conf should look like this:

nameserver 10.0.2.3

3.5 Configure Networking with Slirp to internet and TAP to host:

1. Edit /etc/network/interfaces file to look like the following:

auto lo

# Loopback interface

iface lo inet loopback

# Network interface for internet access (slirp)

auto eth0

iface eth0 inet static

address 10.0.2.15

broadcast 10.0.2.255

netmask 255.255.255.0

gateway 10.0.2.2

# Network interface for private connection to Host OS (tap-win32)

auto eth1

iface eth1 inet static

address 10.0.3.16

network 10.0.3.0

netmask 255.255.254.0

broadcast 10.0.3.255

2. Make sure your "colinux.conf" file has the following lines:

eth0=slirp

eth1=tuntap

Page 11: 1. COOPERATIVE LINUX 1.1 INTRODUCTION ...coLinux requires the use of the TAP-Win32 virtual Ethernet adapter driver. TAP-Win32 allows processes running under a Windows server to access

11 | P a g e

3. You will need to set your DISPLAY variable to "10.0.3.17:0"

root@ubuntu:~# export DISPLAY=10.0.3.17:0

Fig 5: sample /etc/network/interfaces file

4. Now go to Network and Sharing center:

a. Double the Local Area Connection for TAP driver (Local Area Connection 2 in my

case)

b. Navigate to TCP/IPv4 properties and set the following:

Fig 6: Sample Ipv4 settings

Page 12: 1. COOPERATIVE LINUX 1.1 INTRODUCTION ...coLinux requires the use of the TAP-Win32 virtual Ethernet adapter driver. TAP-Win32 allows processes running under a Windows server to access

12 | P a g e

5. Again, go to Network and Sharing center:

a. Select the windows “Local Area connection” and select “Sharing”.

b. Check “allow other network users to connect through this computer’s internet

connection” and select Local Area Connection2 there.

c. We are sharing the internet connection in this manner.

6. coLinux should be able to access the internet. We can run apt to install and update

packages.

apt-get update

3.6 Configuring the Graphical Console:

1. First install the Gnome Display Manager (GDM) which is a graphical login program.

sudo apt-get install gdm

2. After successful installation of gdm, locate and make the following changes in the

/etc/gdm/gdm.conf file

[xdmcp]

Enable=true

[servers]

#0=Standard

3. Restart gdm

/etc/init.d/gdm restart

4. Install vnc which is a remote desktop viewing software

sudo apt-get install vnc4server #vnc for previous versions I suppose

5. As a regular user, set a password for vnc

vncpasswd

Password: colinux (enter whatever you want)

Verify: colinux

Page 13: 1. COOPERATIVE LINUX 1.1 INTRODUCTION ...coLinux requires the use of the TAP-Win32 virtual Ethernet adapter driver. TAP-Win32 allows processes running under a Windows server to access

13 | P a g e

6. Add the below lines to your xstartup file /home/user/.vnc/xstartup

#!/bin/sh

exec gnome-session & # or startkde if you are kde fan

7. Start the vnc service

vncserver :1 -depth 24

(note : value of depth should be in between 8 and 32)

8. Now in the Host OS (windows), install VNC and enter the VNC server name as:

10.0.2.15:1 (Which is the IP of our coLinux system)

9. Enter the password of the server as “colinux”

10. Your graphical console shoud start working.

Fig 7: A Knoppix distro running along with Windows XP

Page 14: 1. COOPERATIVE LINUX 1.1 INTRODUCTION ...coLinux requires the use of the TAP-Win32 virtual Ethernet adapter driver. TAP-Win32 allows processes running under a Windows server to access

14 | P a g e

4. PORTABLE UBUNTU

It is another successful and popular implementation of coLinux wherein an Ubuntu image is used

to run cooperatively inside windows. The portable image of Ubuntu could run in Windows as a

native win32 application. You could execute Linux applications and integrate it in your

Windows desktop.

The speciality of portable ubuntu is that it is fully pre-configured with all necessary settings and

the user only needs to download the zipped file and run the application file after decompressing

it. That means everything that a user had to configure for coLinux to be up-and-running is

completely taken care of beforehand.

The file can be downloaded form http://sourceforge.net/projects/portableubuntu/files/ which is a

550 MB file which when decompressed amounts to around 3.8 GB.

Fig 8: GNU chess (ubuntu) and Chess Titans (windows) running simultaneously

Page 15: 1. COOPERATIVE LINUX 1.1 INTRODUCTION ...coLinux requires the use of the TAP-Win32 virtual Ethernet adapter driver. TAP-Win32 allows processes running under a Windows server to access

15 | P a g e

Portable Ubuntu makes for a great place to test out your more cutting-edge stuff, without having

to worry about messing up your working Windows system. The latest beta of Firefox 3.1/3.5?

Even easier to run than the portable solution, and you can keep both your Windows and Portable-

Ubuntu-launched Firefox browsers open at once. When you're running Portable Ubuntu,

Windows treats it like any other program. You can close down individual app windows from

your taskbar, and pop it onto and off your desktop with little hassle.

5. PROS AND CONS OF COOPERATIVE LINUX

5.1 USES

1. Relatively effortless migration path from Windows:

In the process of switching to another OS, there is the choice between installing another

computer, dualbooting, or using a virtualization software. While the first option costs money,

the second is tiresome in terms of operation, but the third can be the most quick and easy

method especially if it’s free. This is where Cooperative Linux comes in.

2. Using Linux as a Windows firewall on the same machine:

As a likely competitor to other out-of-the-box third-party Windows firewalls, iptables along

with a strippeddown Cooperative Linux system can potentially serve as a network firewall.

3. Linux kernel development / debugging/ research and study on another operating

systems:

While running a Cooperative Linux kernel, you can hardly tell the difference between it and

a standalone Linux. So, deployment of a new feature or testing of any new software can

easily be done on coLinux without any problem.

4. Adding Windows machines to Linux clusters:

The Cooperative Linux patch is minimal and can be easily combined with others such as the

MOSIX or Open-MOSIX patches that add clustering capabilities to the kernel. This work in

progress allows adding Windows machines to super-computer clusters, where one illustration

could tell about a secretary workstation computer that runs Cooperative Linux as a screen

saver—when the secretary goes home at the end of the day and leaves the computer

unattended, the office’s cluster gets more CPU cycles for free.

Page 16: 1. COOPERATIVE LINUX 1.1 INTRODUCTION ...coLinux requires the use of the TAP-Win32 virtual Ethernet adapter driver. TAP-Win32 allows processes running under a Windows server to access

16 | P a g e

5.2 DISADVANTAGES

1. Since the CoLinux runs aside the Windows kernel, so a problem in the Linux kernel can

bring the Windows kernel down, if Linux violates the Windows address space.

2. Inside this CPU abstraction layer, there is no hardware memory protection.

3. Another disadvantage is security. If a malice user gains root access inside CoLinux he

can compromise the security of the Windows system as well. Also to load and use

CoLinux the user has to have administrator rights. (There is the possibility to start

CoLinux as a service, so it is possible to start CoLinux as a normal user, if the user has

been granted the right to start the service)

4. The primary disadvantage of coLinux is that it has the ability to crash the entire system

(all cooperating operating systems) because the guest operating system runs in a

privileged mode in the host kernel. It also has some dependencies on external software

for normal operation (windows and networking support). But no such crash has been

reported till this date.

5.3 WHY USE coLinux? (Advantages)

1. coLinux is fast and lightweight.

2. Why bother running a full-on emulator (VMware, Virtual box etc.), when the kernel is

opensource and can be modified to run as a process within another OS.

3. Traditional VMs are unprivileged and being under the complete control of the host

machine.

4. Because of its priviledged nature, all development and testing related tasks requiring the

kernel interaction can be easily achieved with coLinux.

5. coLinux is a great way to use and experiment with Linux.It allows you to develop and

execute Linux applications on the Windows operating system.You can also maintain the

Linux operating system by installing, upgrading, or removing applications with apt-get.

6. Another interesting advantage of coLinux is its portability.You can have a coLinux

distribution with a custom set of applications on a given Windows host (within the root

file system). You can move the root file system to another host, and then restart it.

Page 17: 1. COOPERATIVE LINUX 1.1 INTRODUCTION ...coLinux requires the use of the TAP-Win32 virtual Ethernet adapter driver. TAP-Win32 allows processes running under a Windows server to access

17 | P a g e

6. PLANNED FEATURES

6.1 Suspension:

Software-suspending Linux is a challenge on standalone Linux systems, considering the entire

state of the hardware need to be saved and restored, along with the space that needs to be found

for storing the suspended image. On User Mode Linux suspending is easier— only the state of a

few processes needs saving, and no hardware is involved. However, in Cooperative Linux, it will

be even easier to implement suspension, because it will involve its internal state almost entirely.

The procedure will involve serializing the pseudo physical RAM by enumerating all the page

table entries that are used in Cooperative Linux, either by itself (for user space and VMalloc

page tables) or for itself (the page tables of the pseudo physical RAM), and change them to

contain the pseudo value instead of the real value. The purpose of this suspension procedure is to

allow no notion of the real physical memory to be contained in any of the pages allocated for the

Cooperative Linux VM, since Cooperative Linux will be given a different set of pages when it

will resume at a later time. At the suspended state, the pages can be saved to a file and the VM

could be resumed later. Resuming will involve loading that file, allocating the memory, and fix-

enumerate all the page tables again so that the values in the page table entries point to the newly

allocated memory.

6.2 User Mode Linux inside Cooperative Linux:

The possibility of running UML inside Cooperative Linux is not far from being immediately

possible. It will allow to bring UML with all its glory to operating systems that cannot support it

otherwise because of their user space APIs.

6.3 Live Cooperative Distributions:

Live-CD distributions like KNOPPIX can be used to boot on top of another operating system and

not only as standalone, reaching a larger sector of computer users considering the host OS to be a

Windows variant.

Page 18: 1. COOPERATIVE LINUX 1.1 INTRODUCTION ...coLinux requires the use of the TAP-Win32 virtual Ethernet adapter driver. TAP-Win32 allows processes running under a Windows server to access

18 | P a g e

7. CONCLUSION

We have discussed the various aspects of Cooperative Linux that includes its working, benefits

as well as its demerits. Apart from being a big scary kernel hack, coLinux has the potential to

becoming an alternative to User Mode Linux. Moreover, the implications that Cooperative Linux

has on what is the media defines as ‘Linux on the Desktop’—are massive, as the world’s most

dominant albeit proprietary desktop OS supports running Linux distributions for free, as another

software, with the aimed for possibility that the Linux newbie would switch to the standalone

Linux. As userfriendliness of the Windows port will improve, the exposure that Linux gets by the

average computer user can increase tremendously.

Page 19: 1. COOPERATIVE LINUX 1.1 INTRODUCTION ...coLinux requires the use of the TAP-Win32 virtual Ethernet adapter driver. TAP-Win32 allows processes running under a Windows server to access

19 | P a g e

8 REFERENCES

[1] Dan Aloni, Cooperative Linux. Proceedings of the Linux Symposium.

[2] M.Tim Jones, Consultant Engineer, Emulex, http://www.ibm.com/developerworks/library/l-

virtualization-colinux/

[3] Coperative Linux, http://colinux.org/

[4] Cooperative Linux installation and configuration,

http://www.saltycrane.com/blog/2008/04/install-colinux-and-ubuntu-gutsy-on-win/

[5]Cooperative Linux files, http://sourceforge.net/projects/colinux/files/

[6] Cooperative Linux, http://colinux.wikia.com/wiki/Main_Page

[7] Cooperative Linux configuration, http://articles.techrepublic.com.com/5100-22_11-

5587457.html

[8] Portable Ubuntu, http://lifehacker.com/5195999/portable-ubuntu-runs-ubuntu-inside-

windows

Page 20: 1. COOPERATIVE LINUX 1.1 INTRODUCTION ...coLinux requires the use of the TAP-Win32 virtual Ethernet adapter driver. TAP-Win32 allows processes running under a Windows server to access

20 | P a g e

ACKNOWLEDGEMENT

I owe a great many thanks to a great many people who helped and supported me

during my seminar.

My deepest thanks to Dr. M.A. Zaveri, Guide of the seminar, for guiding and correcting various

documents of mine with attention and care. He has taken pain to go through the seminar report

and make necessary corrections as and when needed.

I would also like to express my sincere gratitude to my Institution and my Faculty without whom

this seminar would have been a distant reality. I also extend my heartfelt thanks to my family and

well wishers.

Kuldeep Kachari

U07CO269

B.Tech IV

Computer Engineering

SVNIT, Surat