## FANDOM

235 Pages

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 Edit

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) Edit

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 Edit

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: Edit

<?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 Edit

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 Edit

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 Edit

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


To include the ability to copy and paste between vnc clients and the host OS, add the following line inside the for loop in the start() routine:

sudo -H -u $u vncconfig -nowin -display :1 &  (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 Edit 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


I ran into a problem with the following error when trying to run the command below:

emerge -a vim

!!! ARCH is not set....Are you missing the /etc/make.profile symlink?
!!! Is the symlink correct?  Is your portage tree complete?


The following commands will fix this error:

cd /etc
rm make.profile
ln -s /usr/portage/profiles/default-linux/x86/2006.0 /etc/make.profile

## Example /var/lib/portage/world Edit

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


## Running X with GDM Edit

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

MassTranslated on Sun Apr 23 17:36:11 UTC 2006
Community content is available under CC-BY-SA unless otherwise noted.