coLinux
(→‎What is coLinux?: delete vandalism)
 
(25 intermediate revisions by 13 users not shown)
Line 8: Line 8:
 
=== Uses of coLinux ===
 
=== Uses of coLinux ===
   
coLinux allows a complete Linux installation such as Debian, Gentoo, or Ubuntu to run in a virtual machine in Windows. Anything that will run on any other Linux computer will run on coLinux, with the following caveats:
+
coLinux allows a complete Linux installation such as Debian, Gentoo, or Ubuntu to run in a virtual machine in Windows. Anything that will run on any other Linux computer will run on coLinux, with the following caveats:
   
 
* Sound support is rather limited
 
* Sound support is rather limited
* to run graphical applications like xterm, Gnome, or KDE, an Xserver such as Cygwin/X or VNC mus be installed on the [ http://wiki.colinux.org/wiki/Getting_Started_with_coLinux#Terminology | Hosting OS ]. Most, X Servers aren't at a level where they support graphically intensive applications like 3D games.
+
* In order to run graphical applications like xterm, Gnome, or KDE, an Xserver such as Cygwin/X or VNC must be installed on the [[Getting_Started_with_coLinux#Terminology |Hosting OS ]]. Most X Servers aren't at a level where they support graphically intensive applications like 3D games.
* Graphics performance is also dependent on the speed of the connection between the [http://wiki.colinux.org/wiki/Getting_Started_with_coLinux#Terminology | coLinux OS ] and the [ http://wiki.colinux.org/wiki/Getting_Started_with_coLinux#Terminology | Hosting OS ].
+
* Graphics performance is also dependent on the speed of the connection between the [[Getting_Started_with_coLinux#Terminology |coLinux OS ]]and the [[Getting_Started_with_coLinux#Terminology |Hosting OS ]].
   
 
coLinux achieves near-native performance for applications which don't use graphical or sound subsystems:
 
coLinux achieves near-native performance for applications which don't use graphical or sound subsystems:
Line 31: Line 31:
 
coLinux can run complete windowing environments like Gnome, KDE, or XFCE, but these are large applications which tax the limits of most X Servers.
 
coLinux can run complete windowing environments like Gnome, KDE, or XFCE, but these are large applications which tax the limits of most X Servers.
   
=== Why coLinux and not Xming or Cywgwin/X ? ===
+
=== coLinux without graphics ===
   
  +
If KDE or even a simple xterm over ssh seems too slow, it is entirely possible to make use of coLinux without installing any sort of Xserver on the [[Getting_Started_with_coLinux#Terminology|Hosting OS]]. It is possible just to use a regular windows command prompt as a terminal attached to the [[Getting_Started_with_coLinux#Terminology|coLinux OS]].
One user reports: "I have never been able to get X in Cygwin to start up reliably. And even when it does start, running a desktop environment like KDE, or even just an X-based application over ssh, is quite slow."
 
   
 
=== So, do I need to know Linux first ? do I need Cygwin ? ===
 
=== So, do I need to know Linux first ? do I need Cygwin ? ===
   
  +
coLinux is a great way to learn how to use a Linux system. If you don't install a server like Cygwin, you will have to use a regular Windows command shell as your coLinux terminal.
No, you don't. But it will help you a lot in :
 
* not being disappointend in the end result : a DOS-ugly console for a little while
 
* understanding most of the technical instructions you will find in this quick guide and others
 
* not being discouraged by the slightiest problem you would encounter.
 
   
  +
=== Installation ===
Call it ''Zen'' if you want, but you need to be in the right spirit or you will waste your time.
 
  +
Refer to [[Getting Started with coLinux]]
   
=== So, what do I do now ? ===
+
=== So, if it doesn't work? ===
   
  +
Refer to [[Getting_Started_with_coLinux#Troubleshooting]]
You need to install [[coLinux]] in a directory without space in its path : so c:\colinux or d:\prog2\colinux is ok, but c:\Program Files\[[coLinux]] is NOT ok. (ok, actually in later versions, it seems ok. never mind.)
 
 
If you uninstall then reinstall it in a proper place, you may have to type the following, due to an entry in the registry :
 
<pre><nowiki>
 
colinux-daemon.exe --remove-driver
 
colinux-daemon.exe --install-driver
 
</nowiki></pre>
 
 
If you don't have downloaded one of the proposed images, do it now.
 
 
The extension of the images is .bz2, for bunzip2, so you need a decompressor that understand this format. one comes with Cygwin.
 
 
Next you have to edit the [[coLinux]] configuration file : make a copy of default.colinux.xml, edit the entry to :
 
<pre><nowiki>
 
<block_device index="0" path="\DosDevices\c:\coLinux\image_fs" enabled="true" />
 
</nowiki></pre>
 
 
where c:\[[coLinux]]\image_fs is the image you just downloaded and uncompressed and the path to it. for instance, gentoo-i686-ext3-1gb.bz2 becomes c:\[[coLinux]]\gentoo once uncompressed and renamed to a more sane name.
 
 
Forget about everything else now, including the network : later, later.
 
 
open a command prompt (cmd.exe), and go to the directory where you installed [[coLinux]] then enter :
 
<pre><nowiki>
 
colinux-daemon.exe -c your.colinux.xml -t nt
 
</nowiki></pre>
 
or edit a batch file (.bat) in this directory with the same command. yes, clicking blindly on the .exe will not work.
 
 
[[coLinux]] should start now, in a console. after a few seconds, text will fill the console, hopefully ending with a 'login' prompt. enter 'root' then nothing (no password). on some images, you may have to use 'root' or 'colinux' as the root password, but I know of only one where you need to do that. (ok, actually both recent official images for [[coLinux]] (Debian & Gentoo) do need 'root' as the password for root. some stupid security measure prevented the images to be packaged and shipped with blank password).
 
 
 
now you can type Unix commands and enjoy the promised Linux-on-Windows miracle. To end the session, shutdown the virtual machine by entering one of the following :
 
* halt
 
* poweroff
 
* shutdown -h 0
 
 
=== So, if it doesn't ? ===
 
then take a look at the following.
 
* check the path to the uncompressed filesystem image
 
* in the line with
 
<pre><nowiki>
 
<bootparams>root=/dev/cobd0</bootparams>
 
</nowiki></pre>
 
add ro before root :
 
<pre><nowiki>
 
<bootparams>ro root=/dev/cobd0</bootparams>
 
</nowiki></pre>
 
and be ready to remove it if it doesn't help. you can keep it, it is harmless in most cases (some distributions need it)
 
* finally, take a close look at your text editor. there are some chances that it silently converted the text to UTF-8 and add a invisible marker at the beginning of your configuration file : switch to hexadecimal mode or to another editor and check the top of the file. if so, erase this marker.
 
*in case of a error similar to
 
<pre><nowiki>
 
daemon: exit code 84a08401
 
daemon: error - CO_RC_ERROR_ERROR, line 33, file colinux/os/current/user/file.o
 
</nowiki></pre>
 
redo the following dance :
 
<pre><nowiki>
 
colinux-daemon.exe --remove-driver
 
colinux-daemon.exe --install-driver
 
</nowiki></pre>
 
 
''I did, but it didn't help (same error as before). Whats the reason?'' --> Check your parameters in config-file. Any filename for image, path to vmlinux or swapfile was wrong or don't exist. Comment out all not needed parameters to find the wrong entry in XML file.
 
   
 
=== So, now what ? ===
 
=== So, now what ? ===
You can take a quick look at the
 
<pre><nowiki>
 
<memory size="64" />
 
</nowiki></pre>
 
line and adjust it to fit your system. This is the physical amount of RAM you are going to allocate to [[coLinux]], and you need to keep some to Windows.
 
* if you have 128 Mb of RAM or less, don't bother with [[coLinux]]. ok, use 32 Mb...
 
* 160 to 256 Mb of RAM : put the value 64 Mb
 
* 256 to 512 Mb of RAM : you can increase to 96 Mb
 
* 512 Mb and more : you can use 128 Mb or more if you want.
 
those values are based on personnal experience, your mileage will vary.
 
   
  +
See [[Getting_Started_with_coLinux#Configuration]]
Oh, if you want, you can also tell [[coLinux]] your keyboard is not US with a command line like loadkeys fr-latin1.
 
 
Then you have to configure the network. This is not strictly necessary to enjoy [[coLinux]] but you need it to :
 
* download new software : the image you downloaded contains only a basic system, much like a bare Windows installation.
 
* use ssh and PuTTY, a nice terminal since you will feel the console too unconfortable.
 
* launch X applications and run VNC and see the results on your Windows screen.
 
   
 
=== So, how do I configure the network ? ===
 
=== So, how do I configure the network ? ===
Uh, sorry. This is the hardest part, or actually, it will be here that you encounter the most variety of combinations, and it can be very simple and work at once, or be very confusing. but mostly, '''this is a Windows configuration issue'''. not our fault if their configuration tools are so messy and if Windows can't do some quite simple things.
 
 
Since it can fill several pages of text, go look for hints on another Wiki page.
 
   
  +
See [[Getting_Started_with_coLinux#Network]]
Once this is done, you can update your [[coLinux]] system and install new software. but first you may have to configure either /etc/sources.list or run mirrorselect, depending on the image you are using.
 
   
 
=== So, I got apt-get or emerge running, what is next ? ===
 
=== So, I got apt-get or emerge running, what is next ? ===
Line 150: Line 71:
 
I could solve this with:
 
I could solve this with:
 
<pre><nowiki>
 
<pre><nowiki>
"apt-get -u -o APT::Force-[[LoopBreak]]=true install libgcc1"
+
"apt-get -u -o APT::Force-LoopBreak=true install libgcc1"
 
</nowiki></pre>
 
</nowiki></pre>
 
sshd was missing libgcc_s.so.1 that is inside libgcc1.
 
sshd was missing libgcc_s.so.1 that is inside libgcc1.
Line 187: Line 108:
 
assuming Windows is using 192.168.0.1 and the X Window server is listening to display 1.
 
assuming Windows is using 192.168.0.1 and the X Window server is listening to display 1.
   
oh, you need a X server. you can use Cygwin X Server, Xming from http://sourceforge.net/projects/xming, or X-Deep/32 from http://www.pexus.com (freeware).
+
oh, you need a X server. you can use Cygwin X Server, Xming from http://sourceforge.net/projects/xming, or X-Deep/32 from http://www.pexus.com (the X-Deep freeware version was unfortunately discontinued).
   
 
=== So, you told me about VNC, I already know about VNC ? ===
 
=== So, you told me about VNC, I already know about VNC ? ===
Line 235: Line 156:
 
== Appendix ==
 
== Appendix ==
   
=== Hey, shut up and gimme your .xml file ! ===
+
=== Hey, shut up and gimme your .xml file ! ===
   
 
ok, so I installed colinux in c:\coLinux_0.6.2 (because I got 5 other versions), and I store all my .xml files in c:\colinux_0.6.2 and my image files in c:\colinux : you can store everything in one directory, though.
 
ok, so I installed colinux in c:\coLinux_0.6.2 (because I got 5 other versions), and I store all my .xml files in c:\colinux_0.6.2 and my image files in c:\colinux : you can store everything in one directory, though.
Line 260: Line 181:
 
here woody_fs is Debian-3.0r0.ext3.1gb.bz2, uncompressed and renamed. swap_device is a file from http://gniarf.nerim.net/colinux/swap/ and \Device\Harddisk2\Partition2 is a native Linux partition on another disk. (/dev/hdc2, but don't trust the numbers). the network line may look different, too, if you are not using TAP.
 
here woody_fs is Debian-3.0r0.ext3.1gb.bz2, uncompressed and renamed. swap_device is a file from http://gniarf.nerim.net/colinux/swap/ and \Device\Harddisk2\Partition2 is a native Linux partition on another disk. (/dev/hdc2, but don't trust the numbers). the network line may look different, too, if you are not using TAP.
   
  +
----
----[[MassTranslated]] on Sun Apr 23 17:35:45 UTC 2006
+
[[MassTranslated]] on Sun Apr 23 17:35:45 UTC 2006

Latest revision as of 11:49, 5 October 2012

coLinux for Dummies is a not-so-technical guide on how to get started with coLinux. Beginners only.

What is coLinux?[]

coLinux is a piece of software that allows you to run the Linux kernel in Windows 2000 or later versions.

Uses of coLinux[]

coLinux allows a complete Linux installation such as Debian, Gentoo, or Ubuntu to run in a virtual machine in Windows. Anything that will run on any other Linux computer will run on coLinux, with the following caveats:

  • Sound support is rather limited
  • In order to run graphical applications like xterm, Gnome, or KDE, an Xserver such as Cygwin/X or VNC must be installed on the Hosting OS . Most X Servers aren't at a level where they support graphically intensive applications like 3D games.
  • Graphics performance is also dependent on the speed of the connection between the coLinux OS and the Hosting OS .

coLinux achieves near-native performance for applications which don't use graphical or sound subsystems:

  • web servers such as Apache or Zope
  • databases such as PostgreSQL, Oracle, or MySQL
  • standard shells such as Bash or Tcsh
  • standard utilities such as Find, Sed, Awk, etc.
  • interpreted languages such as Python, Perl, Java, or PHP
  • Use compilers such as gcc

coLinux can run the following graphical applications with good performance:

  • xterm
  • Mozilla Firefox
  • Openoffice

coLinux can run complete windowing environments like Gnome, KDE, or XFCE, but these are large applications which tax the limits of most X Servers.

coLinux without graphics[]

If KDE or even a simple xterm over ssh seems too slow, it is entirely possible to make use of coLinux without installing any sort of Xserver on the Hosting OS. It is possible just to use a regular windows command prompt as a terminal attached to the coLinux OS.

So, do I need to know Linux first ? do I need Cygwin ?[]

coLinux is a great way to learn how to use a Linux system. If you don't install a server like Cygwin, you will have to use a regular Windows command shell as your coLinux terminal.

Installation[]

Refer to Getting Started with coLinux

So, if it doesn't work?[]

Refer to Getting_Started_with_coLinux#Troubleshooting

So, now what ?[]

See Getting_Started_with_coLinux#Configuration

So, how do I configure the network ?[]

See Getting_Started_with_coLinux#Network

So, I got apt-get or emerge running, what is next ?[]

Installing the ssh server is often obvious but you must add another user to you system, and give it a password :

adduser mynewusername
passwd mynewusername

no space, no capital or accentued letters, and actually shorter than that. 'colinux' as a user name is ok.

Q: I get the following error when logging in with PuTTY:
"server unexpectedly closed network connection"
The error occurs when I press <enter> after typing in my password.
Anyone have an idea why?

This is a problem of the Debian rootfs that we use. I could solve this with:

"apt-get -u -o APT::Force-LoopBreak=true install libgcc1"

sshd was missing libgcc_s.so.1 that is inside libgcc1. You can see this when you run sshd in debug-mode ("sshd -d") There where some dependency problems. I could solve them with:

cd /var/cache/apt/archives
dpkg -i --force-all sysv-rc_2.86.ds1-14_all.deb 
dpkg -i --force-all sysvinit_2.86.ds1-14_i386.deb 
dpkg -i --force-all initscripts_2.86.ds1-14_i386.deb 
dpkg -i gcc-4.0-base_4.0.3-1_i386.deb 
dpkg -i libgcc1_1%3a4.0.3-1_i386.deb 

after that:

/etc/init.d/ssh restart

works! (or use different rootfs)

So, ssh is running too, where is my GUI ?[]

Installing X is a bit more complex. Don't fear, you don't have to actually configure it, because coLinux will make it run without accessing the video card. (and remember, Windows is already using it.)

The lazy way I recommend to new users is to tell the package manager (apt-get, emerge, yum, urpmi) to install xterm : all dependancies will be taken care of.

Next you can ask to install Gnome or KDE by asking for kdedesktop for instance.

HINT : now I will stress out that on a pratical side, Debian will provide you with precompiled, ready-to-run software, while Gentoo will need to recompile the new software you will want to run : it can take a few hours to build KDE and its dependancies. so, hint hint, stick to Debian woody for today.

now, to test xterm :

export DISPLAY=192.168.0.1:1
xterm &

assuming Windows is using 192.168.0.1 and the X Window server is listening to display 1.

oh, you need a X server. you can use Cygwin X Server, Xming from http://sourceforge.net/projects/xming, or X-Deep/32 from http://www.pexus.com (the X-Deep freeware version was unfortunately discontinued).

So, you told me about VNC, I already know about VNC ?[]

With VNC, you don't have to run the X server on the Windows side, and you get a view to the full Linux desktop. Also, some applications will feel more responsive due to some arcane reasons (menu refresh, the pango library...)

You need to install a VNC server. Its name is often obvious. You don't need a client on the coLinux side (but one on the Windows side, of course) or most other tools named 'vnc'. Just the VNC server.

now go to the home director of the user that will be exporting its display via VNC and edit the file called xstartup in the .vnc directory (create it if needed). adjust its priority to executable via chmod a+x

Now edit it with the following content :

#!/bin/sh
startkde &

(startkde or startxfce or gnome-session or something else, depending on your window manager)

then run

vncserver :1 -depth 16

to start the VNC server, then

vncserver -kill :1

to stop it.

Use coLinux ip and this :1 (display number) when asked in your VNC client running in Windows. example : 192.168.0.40:1

So, what are the next steps ?[]

hey, you already did a lot. or actually, you did read the whole page before doing any actual manipulation. good, very good. what you can do next :

  • do backup of your coLinux images once coLinux is stopped.
    • just copy the relevant file, yes, it is big
    • but you can compress it
  • increase the size of your filesystem image, up to 4 Gb and more on NTFS
    • by using a dedicated tool
    • or moving to a bigger, empty one
  • configure coLinux to use swap (another plain file in Windows)
  • use native partitions where a native Linux system is already installed
  • do your own images of other Linux distribution from various sources
  • rebuild coLinux from within coLinux

the three last items are what would be considered as elite levels of expertise in coLinux usage. contributing to coLinux source code gives you god level.

one important bemol : since you just installed a GNU/Linux operating system, you now need to learn about Linux in general and your distribution of choice in particular. coLinux works so great that it is already out of the picture.

Appendix[]

Hey, shut up and gimme your .xml file ![]

ok, so I installed colinux in c:\coLinux_0.6.2 (because I got 5 other versions), and I store all my .xml files in c:\colinux_0.6.2 and my image files in c:\colinux : you can store everything in one directory, though.

here is a typical .xml file, woody.colinux.xml stored in c:\coLinux_0.6.2 :

<?xml version="1.0" encoding="UTF-8"?>
<colinux>
    <block_device index="0" path="\DosDevices\c:\colinux\woody_fs" enabled="true" />
    <block_device index="1" path="\DosDevices\c:\colinux\swap_device" enabled="true" />
    <block_device index="2" path="\Device\Harddisk2\Partition2" enabled="true" />
    <bootparams>ro root=/dev/cobd0</bootparams>
    <image path="vmlinux"></image>
    <memory size="128"></memory>
    <network index="0" type="tap"></network>
</colinux>

and I run it from woody.bat file containing the following line :

colinux-daemon -c woody.colinux.xml -t nt

here woody_fs is Debian-3.0r0.ext3.1gb.bz2, uncompressed and renamed. swap_device is a file from http://gniarf.nerim.net/colinux/swap/ and \Device\Harddisk2\Partition2 is a native Linux partition on another disk. (/dev/hdc2, but don't trust the numbers). the network line may look different, too, if you are not using TAP.


MassTranslated on Sun Apr 23 17:35:45 UTC 2006