coLinux
Im>Supplikant
AnMaster (talk | contribs)
Line 13: Line 13:
   
 
== Editing the default.colinux.xml config file ==
 
== Editing the default.colinux.xml config file ==
In your `default.colinux.xml` file, all the configuration options for colinux go in. Here is what you should add. After a few lines, you'll see a line which starts with <block_device> and goes on. This is the place you define where the hard drive image file is, and what index it is. (The index is used to place the drive in a correct /dev entry. The location of a drive you add in the colinux config is /dev/cobd/X where X is the index number. The path is simply the path to the image). Of the first <block_device> entry, edit the string after `path=` and change it to say `\[[DosDevices]]\path\to\file\gentoo-i586-ext3-2g-deluxe` Where `\path\to\file` is the location where you extracted colinux to.
+
In your `default.colinux.xml` file, all the configuration options for colinux go in. Here is what you should add. After a few lines, you'll see a line which starts with <block_device> and goes on. This is the place you define where the hard drive image file is, and what index it is. (The index is used to place the drive in a correct /dev entry. The location of a drive you add in the colinux config is /dev/cobd/X where X is the index number. The path is simply the path to the image). Of the first <block_device> entry, edit the string after `path=` and change it to say `\DosDevices\path\to\file\gentoo-i586-ext3-2g-deluxe` Where `\path\to\file` is the location where you extracted colinux to.
   
The default installation path is "C:\Program Files\[[coLinux]]". This may not work. Most of the examples here suggest using just "C:\[[coLinux]]".
+
The default installation path is "C:\Program Files\coLinux". This may not work. Most of the examples here suggest using just "C:\coLinux".
   
But note: if your hard drive image was `hdd.img` and was kept in `C:\` this is the notation: `\[[DosDevices]]\c:\hdd.img`. So any device like `C:` or `D:` has to be preceded by `\[[DosDevices]]\`. For example, if you followed the instructions by the letter and extracted in c:\colinux the string will be
+
But note: if your hard drive image was `hdd.img` and was kept in `C:\` this is the notation: `\DosDevices\c:\hdd.img`. So any device like `C:` or `D:` has to be preceded by `\DosDevices\`. For example, if you followed the instructions by the letter and extracted in c:\colinux the string will be
   
`\[[DosDevices]]\c:\colinux\gentoo-i586-ext3-2g-deluxe`
+
`\DosDevices\c:\colinux\gentoo-i586-ext3-2g-deluxe`
   
 
If you downloaded the swap files from the website,here is what you add: Below the line which says `</block_device>` Add this:
 
If you downloaded the swap files from the website,here is what you add: Below the line which says `</block_device>` Add this:
 
<pre><nowiki>
 
<pre><nowiki>
<block_device index="1" path="\[[DosDevices]]\path\to\file\swap_xxxM"><block_device>
+
<block_device index="1" path="\DosDevices\path\to\file\swap_xxxM"><block_device>
 
</nowiki></pre>
 
</nowiki></pre>
   
Line 33: Line 33:
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
 
<colinux>
 
<colinux>
<block_device index="0" path="\[[DosDevices]]\c:\Gentoo"
+
<block_device index="0" path="\DosDevices\c:\Gentoo"
 
enabled="true" />
 
enabled="true" />
   
<block_device index="1" path="\[[DosDevices]]\c:\swap_512Mb"
+
<block_device index="1" path="\DosDevices\c:\swap_512Mb"
 
enabled="true" />
 
enabled="true" />
   

Revision as of 11:18, 13 May 2006

A good way to get started with coLinux is to start with a blank hard drive image. Here I'll tell about an easy way to get started with the Gentoo Deluxe 2gb image, and how to run X programs, etc. (see also http://www.gentoo.org/doc/en/colinux-howto.xml)

Download coLinux

This is the first step, and if you are here already, this step should have been completed. Just go to http://www.colinux.org to get a new release, but I strongly suggest using the newest snapshot at http://www.colinux.org/snapshots. Just extract the files to `c:\colinux` and you are on your way.

Downloading the Gentoo Deluxe Image (This will happen as part of the setup procedure if requested)

To download the Gentoo Deluxe 2 gb image, go to the sourceforge download site at http://sourceforge.net/project/showfiles.php?group_id=98788. But be aware that it extracts to a whole 2 gb. I STRONGLY suggest that you download one of the swap files (the main package fetcher for Gentoo is "emerge" which downloads the source and auto-compiles for you. But big programs can't compile, and smaller programs take a long time if you do not have enough swap space.) Also note that this is a very stripped down install, so you may have to setup portage and emerge packages as shown below.

The image is in bzip2 format so you can decompress them with cygwin's bunzip2 or 7zip.

Editing the default.colinux.xml config file

In your `default.colinux.xml` file, all the configuration options for colinux go in. Here is what you should add. After a few lines, you'll see a line which starts with <block_device> and goes on. This is the place you define where the hard drive image file is, and what index it is. (The index is used to place the drive in a correct /dev entry. The location of a drive you add in the colinux config is /dev/cobd/X where X is the index number. The path is simply the path to the image). Of the first <block_device> entry, edit the string after `path=` and change it to say `\DosDevices\path\to\file\gentoo-i586-ext3-2g-deluxe` Where `\path\to\file` is the location where you extracted colinux to.

The default installation path is "C:\Program Files\coLinux". This may not work. Most of the examples here suggest using just "C:\coLinux".

But note: if your hard drive image was `hdd.img` and was kept in `C:\` this is the notation: `\DosDevices\c:\hdd.img`. So any device like `C:` or `D:` has to be preceded by `\DosDevices\`. For example, if you followed the instructions by the letter and extracted in c:\colinux the string will be

`\DosDevices\c:\colinux\gentoo-i586-ext3-2g-deluxe`

If you downloaded the swap files from the website,here is what you add: Below the line which says `</block_device>` Add this:

<block_device index="1" path="\DosDevices\path\to\file\swap_xxxM"><block_device>

Where xxx is the amount of MB the swap space is.

Example config file:

<?xml version="1.0" encoding="UTF-8"?>
<colinux>
    <block_device index="0" path="\DosDevices\c:\Gentoo"
    enabled="true" />

    <block_device index="1" path="\DosDevices\c:\swap_512Mb"
    enabled="true" />

    <bootparams>root=/dev/cobd0</bootparams>

    <initrd path="initrd.gz" />

    <image path="vmlinux" />

    <memory size="128" />

    <network index="0" type="tap" />
</colinux>

Starting up the machine

Now that the ouside configuration is done, lets make the gentoo system usable. First execute

colinux-daemon.exe -c colinux.xml

If the config was edited right, and no more errors occured a second window, called "Cooperative Linux Console" will come up. This is your window to the system. After loading for a bit it will come up to a login prompt. For the username type in

root

and for the password, the default password as of January 2005 is "root" (for older versions just hit enter). Congrats! You are now in a gentoo system. Now add the swap to your fstab and activate it.

echo "/dev/cobd/1 none swap sw 0 0" >> /etc/fstab
mkswap /dev/cobd/1 #if you created the image yourself
swapon /dev/cobd/1

You can use the `free` command to see if the swap was enabled.

Getting portage working

In order to make the downloaded disk image smaller, the portage ebuilds may not have been included. This is the case if your getting errors from `emerge sync`.

Note: You should check to see if the networking is functional. You can visit coLinuxNetworking for more information, however, to start networking in Gentoo, just execute `/etc/init.d/net.eth0 start`. Also, if you need to use a proxy, set that up in your `make.conf` file as shown in the section below.

So, you may need to setup the `/usr/portage` package directory. To do this, using wget just download a portage snapshot here or at the mirror closest to you gentoo mirrors and then:

tar xjvf portage-date.tar.bz -C /usr/
emerge sync #this should now work

Starting X with VNC

It's a very good idea to extend the filing system beyond 2GB before the following otherwise you'll run out of disk space.

This, in my opinion, is the best way of using X programs. Before you do this, be sure to get the TightVNC viewer for windows.

Now get the vnc server for linux:

emerge -a tightvnc

Now, if you haven't done so already, you will want to setup a user account for X stuff. I recommend the `superadduser` program for this. For example, I will create a new user named `me`.

emerge -a superadduser
superadduser me

Next you will modify `~/.vnc/xstartup`. This file is sourced by the vncserver when it is first started. Make sure you modify this file for the correct users, not root. Here is my xstartup for starting fluxbox:

#!/bin/sh

xrdb $HOME/.Xresources
xsetroot -solid grey
startfluxbox &

Now you can do a `sudo -u me vncserver` to start the vncserver for under a certain user, but i highly recommend that you automate this as a service. Create the script `/etc/init.d/vnc`, add all of the users you want to in the `$USERS` variable, set the service executable, and add it to the default runlevel. --TimG, I'll add more later.

cat >> EOF
#!/sbin/runscript

USERS="me"

depend() {
        need net
}

start() {
        for u in $USERS;
                do echo "Starting vncserver for user=$u:"
                sudo -H -u $u vncserver :1
        done
        eend 0
}

stop(){
        for u in $USERS;
                do echo "Stopping vncserver for user=$u:"
                sudo -H -u $u vncserver -kill :1
        done
        eend 0
}
EOF

chmod +x /etc/init.d/vnc

rc-update add vnc default


(note on vncserver: if you have 1024x768 resolution, and want to see the taskbar, give vncserver: `-geometry 1000x685`).

The first time you run vncserver, it will ask you for a pasword, so type one in. REMEMBER IT. Now, open up the VNC Viewer you got earlier in the step for windows, and when it asks you for the hosts ip. Type in the gentoo system's ip and add a ":1" to it. (By default, i think it should be 192.168.0.11, so the value in the first box of vnc viewer is "192.168.0.11:1"). Now it will ask you for the session password. Type in the password you created when starting the server. And VOILA! Thats it, you have X working. In order to start X, the next time you start the gentoo system type in the vncserver command again that i said above.

If you started x from the commandline you can stop it with `vncserver -kill :1`, otherwise stop it with `/etc/init.d/vnc stop`.

Example /etc/make.conf

This is my `make.conf`. Note that I have setup portage to use a proxy.

USE="aim -svga -arts"
CFLAGS="-O2 -mcpu=i686 -fomit-frame-pointer"
CHOST="i386-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"

PROXY=10.0.2.44:3456
http_proxy=10.0.2.44:3456
ftp_proxy=10.0.2.44:3456
RSYNC_PROXY=10.0.2.44:3456
RSYNC_TIMEOUT=10


Example /var/lib/portage/world

Here is my `world` file with several packages, in rough order of importance.

net-misc/tightvnc
app-misc/screen
app-admin/superadduser
app-admin/sudo
app-editors/nano
app-portage/esearch
app-editors/emacs
app-emacs/python-mode
dev-python/ipython
net-im/centericq
x11-wm/fluxbox
sys-kernel/linux-headers
x11-terms/aterm
net-analyzer/nmap
sys-libs/glibc
dev-python/twisted
app-admin/gkrellm
x11-misc/xdesktopwaves

Setting up fluxbox with vnc

Running X with GDM

TODO, see http://gentoo-wiki.com


Talk


<piyo, 2004-07-18T13:17:03+0900> If you want more detail about a "VNC terminal server", you could always reference the HOWTO guide Xvnc terminal server. It explains how to set up with KDE (kdm) and/or Gnome (gdm). The above step 5 is good for trying out vnc as root, but surely it is not recommended for normal use.


<piyo, 2004-07-18T13:28:31+0900> You may have more than one gentoo "box" in your LAN. There is a way to proxy "emerge sync" and "emerge _package_" so that accesses to a remote network can be kept to a minimum. Check out the HOWTO guides Local Rsync Mirror and Download Cache for LAN-Http-Replicator.



<stefan, 20004-09-09> Uhm... exactly how is a windowsuser supposed to be able to use something as nonuserfriendly as vim?!? Anyone capable of using vim probably doesn't need this tutorial to begin with and a compleat beginner to Linux have enough things to wrap his mind around without trying to learn right there and then a texteditor with an aqward UI that doesn't even follow the defacto Linux standard for how to quit the app.

Changed all default instructions to use nano instead.



<inwits, 2004-09-19> tbh mate, this isn't exactly the best route for a beginner to get into linux. better to acquire a spare pc and do a mandrake or redhat install... much simpler.


<Razor-X, 2004-10-24> Well, personally, i'd find double booting an OS or wiping a HDD for the first time a bit daunting of a task for a first time Linux user, but maybe i'm the only one that respects my data ;-P. And to the vi note, i'm a 14 year old (13 when I wrote the original doc) and I swear by vi even still. I don't think vi should be THAT hard to pick up (and it also did not occur to me that there were simpler editors, even though I had used nano). Thanks everyone for contributing to the doc. Things like this show the true power of a wiki.


You will probably rapidly find the 2G is small for your root FS. Please have a read of ExpandingRoot for help to create a bigger one.


42. Ready for some more fun Take a look at Gentoo tips and tricks GentooTAT


<TimG, 7/29/2005> Updated and changed most sections. Added example config files. Hope its useful.


<DanEllis, 2006-3-25>Updated a bit based on recent experience. emerge -sync worked without the portage directory, and anyway there was no way to download it (there being no lynx or ftp in the default distribution). Also loading tightvnc filled the disc.


MassTranslated on Sun Apr 23 17:36:11 UTC 2006