Cooperative Linux

From Free net encyclopedia

Image:Colinux.png Cooperative Linux, abbrieviated as coLinux, is software that lets Microsoft Windows cooperate with the Linux kernel to run both in parallel on the same machine.

Contents

Overview

Cooperative Linux utilizes the concept of a Cooperative Virtual Machine (CVM). In contrast to traditional VMs, the CVM shares resources that already exist in the host OS. In traditional (host) VMs, resources are virtualized for every (guest) OS. The CVM gives both OSs complete control of the host machine while the traditional VM sets every guest OS in an unprivileged state to access the real machine.

The term "cooperative" is used to describe two entities working in parallel. In effect Cooperative Linux turns the two different operating system kernels into two big coroutines. Each kernel has its own complete CPU context and address space, and each kernel decides when to give control back to its partner.

However, whilst both kernels theoretically have full access to the real hardware, modern PC hardware is not designed to be controlled by two different operating systems at the same time. Therefore the host kernel is left in control of the real hardware and the guest kernel contains special drivers that communicate with the host and provide various important devices to the guest OS. The host can be any OS kernel that exports basic primitives that allow the Cooperative Linux portable driver to run in CPL0 mode (ring 0) and allocate memory.

History

Dan Aloni originally started the development of Cooperative Linux based on similar work with User-mode Linux. He open sourced the software under the GNU General Public License. Other developers have since contributed various patches and additions to the software.

Comparisons

Cooperative Linux is significantly different than traditional virtualization solutions such as VMware, plex86, Virtual PC, and other methods such as Xen, which generally work by running the guest OS in a less privileged mode than that of the host kernel. In contrast, the CPL0 approach simplified design with an early-beta development cycle of only one month -- starting from scratch by modifying the vanilla Linux 2.4.23-pre9 release until reaching to the point where KDE could run.

The only downsides to the CPL0 approach is stability and security. If it's unstable, it has the potential to crash the system (on ealier releases before ioperm was disabled attempting to start a normal X server under colinux would crash the host). However, measures can be taken, such as cleanly shutting it down on the first internal Oops or panic. Another disadvantage is security. Acquiring root user access on a Cooperative Linux machine can potentially lead to root on the host machine if the attacker loads specially crafted kernel module or, if the Cooperative Linux kernel was compiled without module support finds some other way to inject code into the running colinux kernel.

Distribution

Most of the changes in the Cooperative Linux patch are on the i386 tree -- the only supported architecture for Cooperative at the time of this writing. The other changes are mostly additions of virtual drivers: cobd (block device), conet (network), and cocon (console). Most of the changes in the i386 tree involve the initialization and setup code. It is a goal of the Cooperative Linux kernel design to remain as close as possible to the standalone i386 kernel, so all changes are localized and minimized as much as possible.

The coLinux package installs a port of the Linux kernel and a virtual network device and can run simultaneously under a version of the Windows operating system such as Windows 2000 or Windows XP. It does not use a virtual PC such as VMware. X Window or X Servers will not run under coLinux directly, but you can install an X Server under Windows, such as Cygwin/X or Xming and use KDE or GNOME and almost any other Linux application and distribution. Debian and Gentoo are especially popular with the coLinux users. Applications such as MySQL are also known to work well. This allows a user to safely learn Linux without going to the trouble of wiping out existing operating systems, or creating a separate partition.

Due to the rather unusual structure of the virtual hardware installing linux distros under colinux is generally difficult. Therefore users generally use either an existing linux install on a real partition or ready made filesystem images distributed by the project. The filesystem images are made by a variety of methods including taking images of a normal linux system, finding ways to make installers run with the strange hardware, building installs up using the package manager by hand or simply upgrading existing images using tools like yum and apt.

There is different kind of changes to do in order to make a distribution work under colinux:

  • make change to some files in the distributions so it behave normaly(there are also some programs that behave strangely)
  • there is no X11 inside colinux because it has no access to the video-card hardware...so the distribution needs to act as an X11 client and an X11 server running under Windows needs to be conected to the X11 client

See also

External links

fr:Cooperative Linux ja:Cooperative Linux