This steb-by-step HOWTO shows how to do full CD-based install of Xubuntu using coLinux. The "initrd clue" though (read below) should apply to any distro (I've used it succesfully for slackware 11.0).
This HOWTO should be in general applicable to ANY distro that supports text-console based installation.
If you set up X server on Windows prior to installation and will figure out how to force installer to redirect output to external X server (for sure network has to be set up already), than maybe you'll have success installing some distro with graphical installer. I'll stick to text-based till then...
- NOTE: This is very detailed HOWTO. Sometimes probably detailed to annoyance.
- There are two main reasons for it:
- 1. I've got some basic knowledge on GNU/linux. I don't think I could call myself geek (yet) though. Well, I still remember time of being beginer and hopelessly wasting weeks on searching through net for specific details on various topics. So if I decide to write HOWTO, it should not be understandable by geeks only, but by beginers. Geeks don't need HOWTOs.
- 2. I'm too lazy to put myself into situation where I'll have to read and answer dozens of mails asking for various details on topic I mensioned in this article (it doesn't mean that I won't answer any).
- NOTE: this article is partialy efect of my own exploration of coLinux but probably mostly more of a compilation of knowledge gathered from various places.
- I've got good memory, but it has small drawback - it usually don't last long. I did put links to origins of those fragments I could recall the origin. Some could probably find some fragments that should be linked to its origin, but are not. I'm sorry for that.
- I'd like also thank all those who have shared their knowledge on various forums, that I could put altogether in this article.
Needed and usefull (and free) software:Edit
1. coLinux - no comments (http://sourceforge.net/project/showfiles.php?group_id=98788)
2. cygwin (base install + openssh + e2fsprogs) - lets format partition image to ext3 FS,
- allows for communication coXubuntu->Windows host (http://www.cygwin.com/setup.exe)
- (may also play role of X server and sound server)
3. Xming + Xming-fonts - lets for running linux GUI apps (and even full linux desktop)
4. Xming-portable-putty/PuTTY - lets for communication Windows host->coXubuntu
5.pulseaudio - sound server - will let hear sounds from coXubuntu (http://www.cendio.com/pulseaudio)
6.Xubuntu - no comments (http://www.xubuntu.org/get)
7.7-zip - free archiving app supporting many formats including cpio and iso
NOTE: many "code insertions" in this article contain paths and other elemets you've got to adapt to your needs
Option A Download latest version and run installer (I suggest installing to c:\coLinux)
Option B You may simply extract installer's contents to chosen folder.
If you chose this way, before running it you have to install it's driver running:
If you want to use TAP network interface (you can use more than one), you've got to install it...
- good description: ( TAP-Win32_Adapter_V8_(coLinux)#Installer )
C:\> cd \path\to\coLinux\netdriver C:\> \path\to\coLinux\netdriver> .\tapcontrol.exe install OemWin2k.inf TAP0801co
After this action You'll find one more "Local Area Connection X" in Window's network connections window.
I suggest to rename it to "TAP-coLinux" (I will refer to this name below).
Set its IP preferences to:
IP: 192.168.11.1 netmask: 255.255.255.0
end of option B
I suggest to turn off firewall for this TAP interface ("advanced" tab in windows firewall settings)
...if you don't you'll have comunication issues
There's very low possibility if any that coLinux will try to attack Windows :)
(with e2fsprogs and openssh)
Apart of e2fsprogs and openssh you may consider installing also cygwins X server instead of Xming (Xming is much simpler to configure and use though)
...and cygwins esd/esound instead of pulseaudio (pulseaudio is more "native"? windows app though).
e2fsprogs package will allow to format partition image files to ext3 filesystem.
openssh will allow for coXubuntu->Windows host communication and for remote logins to your windows in general (using secure ssh protocol).
Good installation description can be found here: (http://cygwin.com/ml/cygwin/2006-06/msg00655.html)
(you don't need to follow full procedure. Base cygwin install and sshd service is enough)
- !!! Don't forget installing e2fsprogs package additionally ("Devel" section)!!!
- !!! ...and modifying "Setting up SSH Server" procedure - see below...
...if you're behind a proxy don't forget to specify that in installer...
To have full interaction with windows, including possibility to run windows GUI apps from coXubuntu, you've got to modify a bit standard procedure of sshd service installation...
Using wordpad (try notepad if you want to understand why I say "wordpad" :) ), you have to modify "C:\path\to\cygwin\bin\ssh-host-config" file before you run it.
...Replace all (both) occurences of:
if cygrunsrv -I sshd -d[...]
if cygrunsrv -I sshd -i -d[...]
xming and xming-fontsEdit
...is X server for Windows. Actually it's stripped down and slightly modified version of cygwins X server.
It's required if you want to run GUI linux apps.
(alternatively you can use X server included in Cygwin or any other X server for windows... i.e. one from Hummingbird's "Exceed")
You do install Xming by "standard doubleclick" and following installer...
After install it's helpful to put Xaccess controll file X0.hosts with contents like this:
...into Xmings installation folder.
You can add any IP that you want to allow access to your X server from.
If you plan to run more instances of X server, it's good to create such file for each ot them (X1.hosts, X2.hosts, etc...). I'd suggest to create this file for X0 and X1 at least (you'll see below why).
xming-portable-putty or regular PuTTYEdit
...is ssh client. It allows to communicate with running coXubuntu and start remotely linux apps without need to login into it (thanks to included commandline ssh client - plink.exe).
Most probably you have PuTTY already. It's derivative - xming-portable-putty differs only with place it stores it's settings and session data. Standard PuTTY keeps everyting in windows registry, while xming-portable-putty uses regular files stored in a folder specified in config.
Another difference is run.exe tool, included with xming-portable-putty install, that lets hide windows of program run with it.
plink.exe lets you remotely start applications on coXubuntu. It is commandline tool though, so if you run it, commandline window pops out together with window of application you've started using it.
Here's where the run.exe comes in. It starts app's window in hidden mode, so your desktop remains usable :).
Same run.exe tool can be found in Cygwin's installation (\path\to\cygwin\bin\run.exe).
You can also use similar "standalone" tool from (http://www.turtle.dds.nl/run/)
To hear sound from coXubuntu, you need some network-enabled sound server (since there's no audio hardware coLinux can use).
Pulseadio is such sound server for windows (another I know that works in windows is esd - may be one included with cygwin, or its stripped-down standalone version)
Pulseaudio is available in form of zip archive. You only need to extract its contents somewhere.
Good description of enabling sound for coLinux is here: Sound_support_in_Colinux
...and some more info on pulseaudio: (http://www.linux.com/feature/119926)
To have it started together with coXubuntu, just remember to add line like:
...into coLinux config file associated with coXubuntu.
As I mensioned in preface you can't use GUI installer from standard Xubuntu iso - since there's no graphic card available for coLinux to display graphics to.
That's why you've got to use text based installer included in PC (Intel x86) alternate install CD...
You can get one from i.e.: (ftp://ftp.free.fr/mirrors/ftp.xubuntu.com/releases/7.10/release/xubuntu-7.10-alternate-i386.iso)
Normally system boots off CD and has access to its contents and can run OS installer thanks to initrd. You however won't boot off CD, but still need to run somehow OS installer included in initrd.
In short: You've got to make coLinux to somehow use initrd from CD.
But coLinux has its own initrd and without it it will be hardly usefull, so you can't simply replace one with another.
If you take a closer view on initrd you'll find that it's nothing but system folders tree containing appropriate files needed by the system upon boot.
If so, why not use it as your root filesystem after boot as it in fact is being used upon regular CD-based installation?
In general there are two types of initrd.
- gzipped ramdrive image
- gzipped cpio archive
When used as initrd upon boot it doesn't make any difference for kernel which version it is. Kernel can use properly both types.
But if you want to use it as filesystem it makes big difference. Ramdrive image contains a filesystem and since can be used as is (well, after it's extracted from .gz). While archive is just a structure of files and folders. And thus can't be used by kernel as filesystem (unless kernel has some driver that lets treat archive as filesystem, but it's not our case).
For some distros (i.e. slackware 11.0) where initrd is in form of gzipped ramdrive image, it's enough to extract the image and it can be used...
Unfortunately Xubuntu's CD contains cpio-type one.
You'll have to convert cpio archive into ramdrive image to be able to use it as root FS.
I did the job already, so here you can get ready to use ramdrive image:
Just extract it from the archive using i.e. free 7-zip archiver.
For tough guys the description how to do it can be found on the bottom of this article (could be helpful with future releases):
You still need to create partition's image file that you can install OS to.
Actually two images will be usefull - for system partition (3-5GB) and for swap (256-512MB).
The easiest way is to get pre-prepared images from web:
(http://gniarf.nerim.net/colinux/swap/) - pre-prepared swap images
(http://gniarf.nerim.net/colinux/fs/) - pre-prepared ext3 images
(http://gniarf.nerim.net/colinux/blank/) - pre-prepared unformatted images
It's not a big deal though to prepare one yourself.
As you'll see shortly it will have some advantages too.
There's fsutil.exe tool available in WXP and W2003server that can do what you need.
- fsutil.exe works in W2k too, although it's not included with it.
- You can get it freely though...
[...] You can also download the Windows Server 2003 Service Pack 2 Adminpak directly. To do this, visit the following Microsoft Web sites: For x64 editions: http://www.microsoft.com/downloads/details.aspx?FamilyId=514BD06E-F3BC-4054-8429-C49F51E2190B For x86 editions: http://www.microsoft.com/downloads/details.aspx?FamilyId=86B71A4F-4122-44AF-BE79-3F101E533D95 The SP1 version of the Windows Server 2003 Adminpak is still available. To download the SP1 Windows Server 2003 Adminpak, visit the following Microsoft Web site: http://www.microsoft.com/downloads/details.aspx?FamilyId=E487F885-F0C7-436A-A392-25793A25BAD7 The original release (RTM) version of the Windows Server 2003 Adminpak is still available. To Download the RTM Windows Server 2003 Adminpak, visit the following Microsoft Web site: http://www.microsoft.com/downloads/details.aspx?FamilyID=c16ae515-c8f4-47ef-a1e4-a8dcbacff8e3 [...]
- ...quote from: (http://support.microsoft.com/default.aspx?scid=kb;en-us;304718)
OK, first you've got to create empty file that wil act as our system partition image (3GB is minimum for full desktop install):
(5GB = 1024*1024*1024*5 + 63*512 = 5368741376B)
(3GB = 1024*1024*1024*3 + 63*512 = 3221257728B)
C:\>fsutil file createnew c:\path\to\5G.ext3 5368741376
You also need one for swap partition image (512MB is just enough):
(512MB = 1024*1024*512 + 63*512 = 536903168B)
C:\>fsutil file createnew c:\path\to\swap_512mb 536903168
You could simply format system partition to some linux aware FS and it could be it. But if you read a bit from following links about SPARSE files, you'll want one for your system partition...
Creating SPARSE file in linux is as simple as:
$ dd of=myimage bs=1024 count=0 seek=10240
Here we don't write anything, not even zeroes, we just seek 10mb into the file and close it. The result is a sparse file that is implicitly full of 10mb of zeroes, but that takes no disk space. ls -l will report 10mb, while du and df will report 0. When the file is written to, Linux will allocate disk space for the data. ls will still show 10mb, while du will gradually approach 10mb.
- ...quote from: (http://wiki.linuxquestions.org/wiki/Dd)
But if you'll try to move it to windows it won't be sparse anymore...
That's why you'll have to find a way to create one within windows...
...fortunately mentioned fsutil.exe can do this and that some way:
C:\>fsutil file createnew \path\to\5G.ext3 5368741376 File C:\path\to\5G.ext3 is created C:\>fsutil sparse setflag C:\path\to\5G.ext3 C:\>fsutil sparse queryrange C:\path\to\5G.ext3 sparse range:   C:\>fsutil sparse setrange C:\path\to\5G.ext3 0 5368741376
- NOTE: last two parameters put on the end of last-step command are actually taken from output of previous one...
...Check properties of file created this way (5GB file taking 4KB space on disk !!!)
You can also use some external tool to achieve same result in just one step:
- mksparse.exe - from:  (part about. FileDisk)
C:\>mksparse.exe 5G.ext3 5G
- SparseTest.exe - from: (http://pages.infinit.net/moonligh/eMule/Releases/SparseTest.zip)
For swap images, where it's more important to reserve the data than to save disk space, a non-sparse file is better.
- ...quote from: (http://wiki.linuxquestions.org/wiki/Dd)
OK, lets go on...
Unfortunately partitioning tool used by Xubuntu installer has no support for coLinux's cobd-type devices, so it fails trying to format your unformatted system partition image (somehow it doesn't fail preparing SWAP - it is somehow related to partition table that it tries to write to system partition image as if it was drive, not a partition to it). That's why you've got to format your system partition's image prior to OS installation.
Cygwin will do the job (unless you forgot to include e2fsprogs package upon its install, but even then you can simply re-run cygwin's installer to add missing packages)
C:\coLinux>\cygwin\usr\sbin\mkfs.ext3.exe \path\to\5G.ext3 mke2fs 1.35 (28-Feb-2004) \path\to\5G.ext3 is not a block special device. Proceed anyway? (y,n) y [...]
If you refuse to install Cygwin, you still can achieve the goal i.e. booting your machine with some Live-CD distro, mounting windows partition in it (don't forget RW mode) and doing same steps. ...or you could use some pre-prepared coLinux distro available upon its install or in the net...
Well, you've got our partitions ready now...
You've got to prepare coLinux config file used during Xubuntu installation (i.e.: coXubuntu-7.10-alternate-i386-install.txt). It should contain something like:
kernel=vmlinux mem=256 cobd0=\DosDevices\c:\path\to\5G.ext3 cobd1=\DosDevices\c:\path\to\swap_512Mb cobd2=\DosDevices\c:\path\to\xubuntu-7.10-alternate-i386.iso cobd3=\DosDevices\c:\path\to\xubuntu-7.10-alternate-i386-initrd.rmdrv eth0=slirp,00:FF:2F:61:F9:00,tcp:2222:22/tcp:5910:5900/tcp:5911:5901 initrd=initrd.gz root=/dev/cobd3
- mem - memory amount available for this instance of coLinux
- cobdX - "partition devices" used in this instance of coLinux
- ethX - virtual ethernet devices used in this instance of coLinux
Now you've got to start coLinux using this config file. Following batch script (i.e. coXubuntu-7.10-alternate-i386-install.bat) will do it:
set COLINUX_CONSOLE_FONT=Lucida Console:14 set COLINUX_CONSOLE_EXIT_ON_DETACH=1 c: cd \coLinux colinux-daemon.exe -v 3 -t nt @\path\to\coXubuntu-7.10-alternate-i386-install.txt
- "-v 3" - sets highly verbose output to see eventual problems
- "-t nt" - will start coLinux's nt-type console automatically
You're ready to go now...
Just verify paths and filenames in config and batch files, and run:
If you forgot to include "-t nt" option in batch or console somehow didn't start, or you've closed it by mistake, you can always start another one using colinux-console-fltk.exe or colinux-console-nt.exe from coLinux's install folder.
When you see installer in coLinux's console window...
...I suggest to chose "English" as install-time language (diacritic fonts are not being displayed properly in console window)...
..."country" -> you may choose as you wish...
"Detect keyboard layout" -> "NO" "origin of keyboard" -> as you wish...
"Load CD-ROM drivers from a driver floppy" -> "NO"
"Manually select a CD-ROM module and device" -> "Yes"
"Module needed..." -> "none" "Device file for accessing the CD-ROM" -> "/dev/cobd2"
"Continue the install without loading kernel modules?" -> "Yes"
"Primary network interface" -> "eth0..."
"Hostname" -> "myHostName"
"Partitioning method" -> "manual"
then choose "> #1 5.4 GB K ext3 /media/cobd0"
leave as is: "Format the partition: no, keep existing data"
change "Mount point: /media/cobd0"
to: "/ - the root file system"
then choose: "Done setting up the partition"
for /dev/cobd3 set "Mount point:" to "Do not mount it" (as you won't need initrd after Xubuntu is installed)
in the end choose "Finish partitioning and write changes to disk"
...ignore info about /dev/cobd3 choosing appriopriate options
"Write changes to disk?" -> "Yes"
"Is the system clock set to UTC" -> "No"
NOTE:(for NIS users) You've got to set "admin-user" but remember: it SHOULD NOT use login you want use as yours...
...unless you don't want to be able to use your NIS/NFS shares (homedirs) within your LAN.
...then you wait a while for base packages get installed...
proxy -> i.e.: "http://my.proxy.com:8080/" ...some more waiting...
When it comes to: "Software selection"/"Choose software to install:" -> DON'T choose anything or install fails... ...you'll be able to install whatever you want later on.
After about 0.5h of various packages installation, installer will try to install GRUB, what will fail -> "continue"
When installer gets out to "Main menu" -> "Continue without bootloader"
...after while coLinux will boot starting installer again ...press "Alt+F2" in coLinux's console to get to second virtual console, activate it as it says - pressing "Enter" key. then type in "poweroff" and press "Enter" key to shut down coLinux.
...or simply klick "x" button in upper-right corner of coLinux window, then in "End Program [...]" warning popup window click "cancel". ... coLinux will shut down properly then.
So you've installed Xubuntu on coLinux...
...it still needs some setting/tuning though.
For sure you need new coLinux config file...
How about creating coXubuntu-7.10.txt file containing something like:
kernel=vmlinux mem=384 exec0="\path\to\Xming.exe",":0 -clipboard -multiwindow -lesspointer -nowinkill -nomultimonitors" exec1="\path\to\pulseaudio.exe" cobd0=\DosDevices\c:\path\to\5G.ext3 cobd1=\DosDevices\c:\path\to\swap_512Mb cobd2=\Device\Cdrom0 eth0=slirp,00:FF:2F:61:F9:00,tcp:2222:22/tcp:5910:5900/tcp:5911:5901 eth1=tuntap,"TAP-coLinux",00:11:22:33:44:55 initrd=initrd.gz cofs0=C:\ root=/dev/cobd0
- execX - lets start some apps along with coLinux instance.
- eth1 - additional virtual ethernet interface that will be used for direct coLinux-window shost communication
- Since it's set to "TAP", TAP driver has to be installed already and it's windows name must be same as used in this config
- cofsX - virtual device you can use to have access to windows filesystem from coLinux
- other method is via windows file-sharing and linux's samba client
You also need new starting batch (coXubuntu-7.10.bat):
@echo off set COLINUX_CONSOLE_FONT=Lucida Console:14 set COLINUX_CONSOLE_EXIT_ON_DETACH=1 c: cd \coLinux start "coXubuntu" colinux-daemon.exe -d -v 3 @\path\to\coXubuntu-7.10.txt
Now you can start your coXubuntu using above batch and then its console (\path\to\coLinux\colinux-console-nt.exe)
...and login to account you've created upon install.
It's very useful to know roots password on host you're using so change it to one you'll remember:
user@coXubuntu:/mnt$ sudo passwd root [sudo] password for lukor: Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
If you don't want to type "sudo" for every administering command switch now to root's account:
user@coXubuntu:~$ su - root Password:
To configure direct coLinux-Windows host connection on TAP ("TAP-colinux") interface first set IP and netmask for it in windows (I've setit to IP=192.168.11.1 NETMASK=255.255.255.0), then you've got to modify /etc/network/interfaces in coXubuntu:
root@coXubuntu:~# vi /etc/network/interfaces
After changes it should look something like:
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or # /usr/share/doc/ifupdown/examples for more information. # The loopback network interface auto lo iface lo inet loopback # The primary network interface auto eth0 iface eth0 inet static address 10.0.2.15 gateway 10.0.2.2 netmask 255.255.255.0 # The secondary network interface auto eth1 iface eth1 inet static address 192.168.11.150 netmask 255.255.255.0
- eth0 in this case is set to SLIRP interface in coLinux config file and so it has to use settings as above.
eth1 is set to TAP interface and has to be in same IP-range as TAP interface on windows-side.
root@coXubuntu:~# /etc/init.d/networking restart
And network should be set.
For now you have very base install of Xubuntu. No desktop or even window-manager available. If you don't want full linux desktop, you've got to simply install apps that you want to use.
If you want something like full linux desktop environment, you've got to install at least some window-manager and run another instance of X server on windows in the "single window" mode. I choose XFCE as full desktop since KDE or GNOME may unnecesarilly eat up to much computer's resources that are already used pretty much by windows itself (although I've seen KDE on coLinux install of Gentoo and it was usable).
To widen range of repositories searched, I suggest do some modifications to /etc/apt/sources.list:
root@coXubuntu:/# vi /etc/apt/sources.list
remove "#" from beginning of following lines:
[...] # deb http://us.archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse # deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe multiverse [...] # deb http://archive.canonical.com/ubuntu gutsy partner # deb-src http://archive.canonical.com/ubuntu gutsy partner [...]
Then add following lines to the end of file:
deb http://us.archive.ubuntu.com/ubuntu/ gutsy-proposed main restricted universe multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ gutsy-proposed main restricted universe multiverse
If you want install packages from CD or iso, not from the network, you've got to mount it first and to be sure, comment out all other repos in /etc/apt/sources.list.
To use CD, if you use config proposed above you've got physical drive mapped to /dev/cobd2. So simply mount it using:
root@coXubuntu:/# mount /dev/cobd2 /media/cdrom0
To use iso, you have to get acces to windows filesystem first since iso is over there (you have to have "cofs0=C:\" in your coLinux config):
root@coXubuntu:/# mkdir /media/win root@coXubuntu:/# mount -t cofs /dev/cofs0 /media/win root@coXubuntu:/# mount -o loop /media/win/path/to/xubuntu-7.10-alternate-i386.iso /media/cdrom0
root@coXubuntu:~# apt-get update
root@coXubuntu:~# http_proxy=http://my.proxy.com:8080 apt-get update
...if you're behind proxy - note it, since I won't be repeating proxy example... ..and you may add/remove any package that is in defined repositories (using apt-get). (good tutorial for using apt-get: (http://www.debian.org/doc/manuals/apt-howto/ch-apt-get.en.html))
So you may add default Xubuntu's desktop to your coXubuntu install now:
root@coXubuntu:~# apt-get install xubuntu-desktop xubuntu-artwork xubuntu-restricted-extras openssh-server
It took me about 1h to get it installed.
Now you can also get rid of packages you can't use anyway:
root@coXubuntu:~# apt-get --purge remove linux-generic linux-headers-2.6.22-14-generic linux-headers-generic linux-headers-2.6.22-14 linux-image-generic linux-image-2.6.22-14-generic linux-restricted-modules-2.6.22-14-generic linux-restricted-modules-generic linux-ubuntu-modules-2.6.22-14-generic linux-restricted-modules-common nvidia-kernel-common restricted-manager* xserver-* displayconfig-gtk
Now you have full Xubuntu desktop with XFCE installed.
Some more cleaning:
root@coXubuntu:~# apt-get --purge autoremove root@coXubuntu:~# apt-get --purge clean
XDMCP = FullScreen linux desktopEdit
After installing xubuntu-desktop, your coXubuntu will start GDM on start by default.
GDM itself seems to run fine, but a try to login to some account ends up with blank screen. I didn't manage to figure out what is the cause for this. XDM does work as it should, so I've chosen to use it...
root@coXubuntu:~# apt-get install xdm
...obviously when installer asks you, choose "xdm" as default display manager.
Now you have to modify XDM to allow for remote logins via XDMCP, and to stop it trying to start local X server (it cant sucseed since there's no hardware on coLinux to run X sever on) To do so you've got to add "#" on the beginning of last line in /etc/X11/xdm/Xservers file. After that it should look like:
[...] #:0 local /usr/bin/X :0 vt7 -dpi 100 -nolisten tcp
...and in /etc/X11/xdm/xdm-config add "!" also on the beginning of last line:
[...] ! DisplayManager.requestPort: 0
To allow XDMCP, modify /etc/X11/xdm/Xaccess file removing "#" from the beginning of following line (line 49 in my case):
[...] * #any host can get a login window [...]
...and add one line on the end of file:
[...] LISTEN 192.168.11.150
For those who still want to try GDM, to achieve above goal, here's what has to be done:
To stop starting local X modify /etc/gdm/gdm.conf and/or /etc/gdm/gdm-cdd.conf:
in "[servers]" section add "#" to line (line 160 in my case):
[...] 0=Standard [...]
To enable XDMCP, run:
root@coXubuntu:/# DISPLAY=192.168.11.1:0 gdmsetup
...in "Remote" tab choose "Same as Local"
end of GDM tuning section...
autostarting windows X server after coXubuntu bootsEdit
If you want coXubuntu to automagically display login screen in windows after it starts, add following just before "exit 0" line to /etc/rc.local file:
[...] # notify that system has started if [ -x /etc/rc.notif ]; then /etc/rc.notif & fi
..and create file /etc/rc.notif containing:
#!/bin/sh #/usr/X11R6/bin/xmessage -center "system started" & ssh -i /etc/xming_id_rsa firstname.lastname@example.org "/cygdrive/c/path/to/Xstartup.bat &" &
make sure it's executable:
root@coXubuntu:~# chmod 755 /etc/rc.notif
...now on the windows side create C:\path\to\Xstartup.bat file (make sure paths match) that contains:
@echo off start "X1Server" C:\path\to\Xming\Xming.exe :1 -clipboard -nodecoration -lesspointer -nowinkill -from 192.168.11.1 -query 192.168.11.150 -once
This will work only if coXubuntu->Windows ssh autentication will allow it
To make sure it does you've got to generate and appriopriately distribute ssh keys:
root@coXubuntu:/# ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): /etc/xming_id_rsa Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /etc/ssh/id_rsa. Your public key has been saved in /etc/ssh/id_rsa.pub. The key fingerprint is: 05:23:e2:75:50:a5:b5:ec:f4:80:33:d3:da:ec:02:5b
Now contents of /etc/xming_id_rsa.pub you've got to put into C:\Documents and Settings\user\.ssh\authorized_keys file in windows.
...remember it should be all in one line...
If you've included "cofs0=C:\" statement in coLinux config file, you can do above as follows:
root@coXubuntu:~# mkdir /media/win root@coXubuntu:~# mount -t cofs /dev/cofs0 /media/win root@coXubuntu:/# mkdir /media/win/Documents\ and\ Settings/user/.ssh root@coXubuntu:/# cat /etc/xming_id_rsa.pub >> /media/win/Documents\ and\ Settings/user/.ssh/authorized_keys
to have cofs0 mounted on boot (and since acces to windows filesystem) add following lina to /etc/fstab:
/dev/cofs0 /media/win cofs defaults 0 0
you can do it running:
root@coXubuntu:~# echo "/dev/cofs0 /media/win cofs defaults 0 0" >> /etc/fstab
That's not all though, you still have to add windows-host key to /root/.ssh/known_hosts file. You can do it by hand, but there's easier way too:
root@coXubuntu:~# ssh -i /etc/xming_id_rsa email@example.com The authenticity of host '192.168.11.1 (192.168.11.1)' can't be established. RSA key fingerprint is af:3e:9a:48:2b:a5:f7:8e:55:30:5a:ab:87:2d:d4:ba. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.11.1' (RSA) to the list of known hosts. Last login: Wed Apr 2 11:11:25 2008 from host.domian.com Fanfare!!! You are successfully logged in to this server!!! ;~ user@host ~ $ exit
One more - starting X server should be the very last step in booting sequence. That means that /etc/rc.local should be run as the last...
"who -r" shows what run-level is actually run as default:
root@coXubuntu:/# who -r run-level 2 2008-04-02 10:10 last=
If it's 2, then scripts from /etc/rc2.d/ are being run on boot:
root@coXubuntu:/# ls -1 /etc/rc2.d/ [...] S98usplash S99acpi-support S99laptop-mode S99rc.local S99rmnologin S99stop-readahead S99xdm
...as you can see rc.local is not the last...
you've got to change it:
root@coXubuntu:~# cd /etc/rc2.d root@coXubuntu:/etc/rc2.d# mv S98usplash S97usplash root@coXubuntu:/etc/rc2.d# mv S99acpi-support S98acpi-support root@coXubuntu:/etc/rc2.d# mv S99laptop-mode S98laptop-mode root@coXubuntu:/etc/rc2.d# mv S99rmnologin S98rmnologin root@coXubuntu:/etc/rc2.d# mv S99stop-readahead S98stop-readahead root@coXubuntu:/etc/rc2.d# mv S99xdm S98xdm
Now it should be OK:
root@coXubuntu:/etc/rc2.d# ls -1 [...] S97usplash S98acpi-support S98laptop-mode S98rmnologin S98stop-readahead S98xdm S99rc.local
further coXubuntu configEdit
Now you may add your proper user. If you want to have access to your resources exported as NFS/NIS shares within your LAN, your user has to have same uid and has to belong to group wit same gid as in NIS.
What is your NIS user uid and gid? You may check on machine you've got acces to:
nishost:/home/user>ls -n /home|grep user drwxr-xr-x 73 1234 1234 5120 Apr 1 12:18 user nishost:/home/user>ls -l /home|grep user drwxr-xr-x 73 user user 5120 Apr 1 12:18 user
...as you can see my uid=gid=user=1234
So you can go on now...
If you've installed X server on windows properly and added proper coXububtu's IP to "X0.hosts" (check "X1.hosts" also - XDM will need it!) and you've added to coLinux config proper exec statement starting this X server, following should work now:
root@coXubuntu:~# DISPLAY=192.168.11.1:0 users-admin
First create new group named same as login you want to use and with proper gid value ("Manage Groups" button), ...then the user itself (with proper login, uid value, and base group set to the one you;ve just created), ...in "User-Priviledges" tab set appriopriate priviledges (administrative are useful :) ).
If you cant manage to start GUI app, you can still do the same from commandline:
root@coXubuntu:~# groupadd -g 1234 user root@coXubuntu:~# useradd -u 1234 -g 1234 -m -d /home/user user root@coXubuntu:~# passwd user
To be able to mount NFS shares, you'll need "nfs-common" package:
root@coXubuntu:~# apt-get install nfs-common
You've got to create folders that these shares will be mounted to:
root@coXubuntu:~# mkdir /media/bya_home
Now to have it mounted on boot add to /etc/fstab line like:
nishost.domain.com:/export/nis_home /media/nis_home nfs nolock
22.214.171.124:/export/nis_home /home_nis nfs nolock
You can do it by running:
root@coXubuntu:~# echo "nishost.domain.com:/export/nis_home /nis_home nfs nolock" >> /etc/fstab
Similarily with windows (samba) shares:
root@coXubuntu:~# apt-get install smbfs
In this case you'll mount shares for specific user, so do it in his homedir:
root@coXubuntu:~# sudo -u user mkdir /home/user/home_win root@coXubuntu:~# sudo -u user mkdir /home/user/home_smbhost
//192.168.11.1/user /home/user/home_win smbfs rw,uid=user,gid=user,credentials=/etc/smb.auth,iocharset=iso8859-2,codepage=cp852 0 0 //126.96.36.199/user$ /home/user/home_smbhost smbfs rw,uid=user,gid=user,credentials=/etc/smb.auth,iocharset=iso8859-2,codepage=cp852 0 0
you might notice /etc/smb.auth above - it should contain your users credentials:
root@coXubuntu:/# echo "username=domain\user" > /etc/smb.auth root@coXubuntu:/# echo "password=userspswd" >> /etc/smb.auth
Make sure not anyone can read this file:
root@coXubuntu:/# chmod 600 /etc/smb.auth
You're almost done. You can reboot coXubuntu to have all the changes aplied and to check if everything works as expexted:
After reboot borderless window with XDM login invitation should appear on your screen. If you log in, XFCE Xubuntu's desktop should show up.
starting coXubuntu apps remotely from windowsEdit
You still can run coXubuntu apps without actually loggin into it. Just create yourself windows shortcuts with targets similar to those:
\path\to\run.exe \path\to\PuTTY\plink.exe -ssh -2 -batch -pw passwd firstname.lastname@example.org DISPLAY=192.168.11.1:0 /usr/bin/xeyes & \path\to\run.exe \path\to\PuTTY\plink.exe -ssh -2 -batch -pw passwd email@example.com DISPLAY=192.168.11.1:0 /usr/bin/xtrm & \path\to\run.exe \path\to\PuTTY\plink.exe -ssh -2 -batch -pw passwd firstname.lastname@example.org DISPLAY=192.168.11.1:0 /usr/bin/firefox &
If you don't want to put your password in plaintext like that, you have to exchange ssh keys as with Xming before...
One observation on this: PuTTY stores keys in a bit different manner than openssh, so it's not enough to simply copy it over...
PuTTY's tool puttygen though can convert openssh key;s format into its own.
So generate key pair for your user:
user@coXubuntu:~$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/user/.ssh/id_rsa): Created directory '/home/user/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/user/.ssh/id_rsa. Your public key has been saved in /home/user/.ssh/id_rsa.pub. The key fingerprint is: f7:85:8e:f8:5b:3f:76:34:b3:74:34:9a:fa:f9:e5:69
Put generated public key (id_rsa.pub) into /home/user/.ssh/authorized_keys file:
user@coXubuntu:~$ cat /home/user/.ssh/id_rsa.pub > /home/user/.ssh/authorized_keys
copy private key (id_rsa) to windows...
Run puttygen in windows and Load just copied private key into it...
If it is read successfully, save private (id_rsa.ppk) and public (id_rsa.pub) keys somewhere on disk
(i.e. where cygwin stores your users ssh data: C:\Documents and Settings\user\.ssh\id_rsa.ppk)
Now you may create shortcuts like that:
\path\to\run.exe \path\to\PuTTY\plink.exe -ssh -2 -batch -i C:\Documents and Settings\user\.ssh\id_rsa.ppk email@example.com DISPLAY=192.168.11.1:0 /usr/bin/firefox &
NOTE: The programs rsh and rlogin will not work over a slirp link. Telnet and ssh work fine, though.
So if You really need it, You have to use different interface type.
Hmm. That is all, I think... :)
tough guys appendix - cpio to ramdrive conversionEdit
Ok, so we want get cpio-type initrd.gz from CD and convert it into ramdrive-type.
It's not a big deal in linux...
We mount CD's iso using loop device
(if we don't have/don't want to use regular CD):
[root@linux ~]# mkdir /path/to/isomnt [root@linux ~]# mount -o loop /path/to/xubuntu-7.10-alternate-i386.iso /path/to/isomnt
...then we can access iso's contents in /path/to/isomnt
Inside iso, in /isolinux/isolinux.cfg file we find path to where to find our initrd...
(in xubuntu: initrd=/install/initrd.gz)
we need to copy this initrd.gz somewhere on hdd.
I've called it xubuntu-7.10-alternate-i386-initrd.gz
Now the conversion:
1. lets get env ready:
[root@andLinux ~]# mkdir /tmp/xubuinitrdimg
2. We need to create empty 15MB file, that will become image of our ramdrive:
[root@andLinux ~]# dd if=/dev/zero of=/path/to/xubuntu-7.10-alternate-i386-initrd.rmdrv bs=1048576 count=15
3. now we format it with ext2 filesystem:
[root@andLinux ~]# mkfs.ext2 /path/to/xubuntu-7.10-alternate-i386-initrd.rmdrv
4. we mount our empty image to /tmp/xubuinitrdimg:
[root@andLinux ~]# mount -o loop /path/to/xubuntu-7.10-alternate-i386-initrd.rmdrv /tmp/xubuinitrdimg
5. now we can extract contents of our initrd.gz into the ramdrive image:
[root@andLinux ~]# cd /tmp/xubuinitrdimg [root@andLinux xubuinitrdimg]# gzip -dc /path/to/xubuntu-7.10-alternate-i386-initrd.gz | cpio -id 25369 blocks
6. finally some cleanup:
[root@andLinux xubuinitrdimg]# rm -rf lost+found [root@andLinux xubuinitrdimg]# cd /tmp [root@andLinux tmp]# umount /tmp/xubuinitrdimg [root@andLinux tmp]# rmdir /xubuinitrdimg
So, we're done. Now we've got to move our xubuntu-7.10-alternate-i386-initrd.rmdrv to windows...
I did manage to do most of this in windows too using combination of tools: filedisk + ext2fsd + cygwin (e2fsprogs,cpio)/7-zip Manager
...unfortunately windows doesn't support *nix specific files (links) and file attributes, so I didn't manage to get copied into ramdrive's image exactly what I wanned (during copying some file attributes got lost and links were converted to window's *.lnk files). I tried extracting with 7-zip File Manager and Cygwin's cpio tool with similar results.
Although ramdrive image was fine, mountable with no filesystem errors (checked with fsck), readable and writable, it was useless as initrd.
For hardcore-guys here's how I did it:
(maybe at least parts of it will be usable for some different purposes)
- filedisk (http://www.acc.umu.se/~bosse/)
- ext2fsd (http://ext2fsd.sourceforge.net/projects/projects.htm#ext2fsd)
- cygwin (http://www.cygwin.com/setup.exe)
- 7-zip (http://www.7-zip.org)
C:\>net start filedisk
extract Ext2Fsd-0.45.zip to some folder,
to allow writes to ext2FS, we need to modify \path\to\Ext2Fsd\Setup\ext2fsd.inf file first
...in [Ext2Fsd.Service.Reg] section change:
...we can do it after install also modyfying entry in window's registry:
Now we can install it:
C:\>cd \path\to\Ext2Fsd\Setup\ C:\path\to\Ext2Fsd\Setup>Setup.bat xp The Linux ext2 file system driver service was started successfully.
Let's create empty file that will be out ramdrive image:
C:\>fsutil file createnew \path\to\xubuntu-7.10-alternate-i386-initrd.rmdrv 15760896 File C:\path\to\xubuntu-7.10-alternate-i386-initrd.rmdrv is created
Let's format it to ext2:
C:\>\cygwin\usr\sbin\mkfs.ext2.exe \path\to\xubuntu-7.10-alternate-i386-initrd.rmdrv mke2fs 1.35 (28-Feb-2004) \path\to\xubuntu-7.10-alternate-i386-initrd.rmdrv is not a block special device. Proceed anyway? (y,n) y [...]
Now we can mount it under some unassigned drive letter:
C:\>\path\to\filedisk.exe /mount 0 c:\path\to\xubuntu-7.10-alternate-i386-initrd.rmdrv r:
What is still to be done is extracting contents of our cpio-type initrd (\path\to\xubuntu-7.10-alternate-i386-initrd.gz) into the ramdrive image:
option A (cygwin's cpio tool)
Start cygwin's console either from link or from commandline:
C:\>C:\cygwin\bin\bash.exe --login -i oracz@oracz-c1 ~ $[
go to mounted ramdrive's image:
$ cd /cygdrive/r/
we can remove lost+found from there since we won't need it:
$ rmdir lost+found
Now, let's extract contents of our cpio-type initrd.gz into it:
$ /usr/bin/gzip -dc /cygdrive/c/tools/coLinux/img/coXubuntu_install/initrd.gz | /usr/bin/cpio -id 25369 blocks
we may exit cygwin now:
end of option A
option B (7-zip File Manager)
Open \path\to\xubuntu-7.10-alternate-i386-initrd.gz in 7-zip File Manager,
doubleclick initrd folder you should find inside.
Now you should see initrd's contents (several folders and a file).
Select it all with mouse or ctrl+a
Chose Copy to... from context menu.
In the window that shows up type ramdrive's location:
R:\and click OK.
After extraction is complete, you can close 7-zip.
We may still remove folder lost+found from our ramdrive since we won't need it:
end of option B
...our ramdrive image is ready...
...before use though, we got to unmount it first (don't switch following steps or you'll end up with need to reboot windows):
C:\>\path\to\filedisk\filedisk.exe /umount r: r: Incorrect function.
...don't bother above notice...
C:\>\path\to\Ext2Fsd\Setup\mount.exe /umount r: Mount/Umount 1.5 by Matt Wu <firstname.lastname@example.org>. http://ext2.yeah.net. Usage: mount/unmount disk_number partition_number driver_letter please execute diskmgmt.msc to query disk/partition numbers. Ex: To mount partition 1 of harddisk 0 to f:, then mount 0 1 f: Ex: To unmount f:, then unmount f: or mount /umount f: \path\to\Ext2Fsd\Setup\mount.exe: now unmounting r: ... umount: DosDevName: \\.\r: Succeed.
And that's it.