Friday, November 24, 2006

Colinux on Windows Vista

This information is outdated! See Mobile Ubuntu Colinux Setup for more information, even if you're not using a "mobile" setup ;-)

In the last years colinux became one of my most valued tools for cross platform software development. Colinux is a user mode linux, running as a Windows process. This way you don't need to dual boot anymore. And while other virtualization techniques exist, colinux has some advantages that makes it my top choice.

The last couple of days I switched to Vista on my workstation. Getting colinux to run was one of my major concerns and one of the reasons why I will have to wait before I can use a 64 bit Windows. After a little research on the web I found out that the tuntap driver that is bundled with the colinux 0.8 snapshot will render a Vista installation unusable. So at first I installed colinux without networking support. Then I downloaded the latest openvpn beta and installed the tuntap driver from their installation package. But when I booted into colinux, I couldn't get the network to work. On shutting down colinux Vista even bluescreened. So tuntap is not the way to go (yet).

My next attempt was to use winpcap networking. I managed to get the network up and running, but I had some strange connection problems when connecting via ssh to my colinux. Somewhere the ssh just timed out the connection. After a little experimentation I found out that I could open a tcp connection to the colinux and could even send data to a running netcat, but I couldn't get any data back.

Then I checked if the problem still existed when I used the Microsoft Loopback Adapter in a setup very similar to this colinux networking howto. Surprisingly the network was not only faster, but also very stable. I still don't know why the winpcap solution didn't work reliably over the real network device - connections from/to outside my Windows box work without problems.

After setting up colinux with cofs as my cross compilation toolchain, I was ready to use Vista as primary devlopment platform. So far I'm quite impressed. Vista is the first Windows where I can easily work as "normal" user, entering the administrator password only when I need more access. This is a big security plus.

Thanks to the user account protection old programs like teraterm still work. It took some time until I figured out why nothing changed when I was editing the teraterm.ini file in the "C:\Program Files\" folder. Since teraterm opens this file writable at startup, Vista silently set up a copy of the file in my local user account folder. This way you can edit setting files for legacy programs without needing superuser privileges.

While setting up Visual Studio 8, I had one more encouter of the third kind with rights management. To make debugging easier, I'm inserting information about my classes in "..\Microsoft Visual Studio 8\Common7\Packages\Debugger\autoexp.dat". I edited this file as superuser, since Visual Studio doesn't need to write to it. But nothing happened. Then I checked the file permissions and it became evident that the file was not readable by my user. Changing the permissions fixed this problem, too.

Now I'm up and running and still quite impressed by Windows Vista. If Vista shows the same progress that Windows XP showed during it's lifecycle, it will become a nice operating system for software development. Um, and yes, it was only a few years ago that I preferred linux for my daily work - but back than Visual Studio 8 wasn't available, which is still my killer application for C++ development.

Update:
An updated article on a Mobile Ubuntu Colinux Setup for my laptop is available.

27 comments:

  1. Hi Klimek,
    Could you help me provide more detail about coLinux on Vista ? Which coLinux version you do success using on Vista ? I always has a Bluescreen problem after coLinux shutdown on every version I try (some installed without TAP).

    ReplyDelete
  2. Hi Wisut,

    I'm using a version that calls itself 0.8.0 from Henry's site (http://www.henrynestler.com/). I first installed the 20061003 version (without tap) and than replaced the binaries with the 20070114-flushtlb version (see http://www.henrynestler.com/colinux/testing/devel-0.8.0/ and http://www.henrynestler.com/colinux/testing/devel-0.8.0/20070114-flushtlb/readme.txt)
    Later I installed the tap for vista driver that is available at Henry's site right at the home page.

    Cheers,
    Manuel

    ReplyDelete
  3. but linux is vary tough even for technical guy and to troubleshooting it vary stressfull task but windows is vary easy to use.

    anyway vary nice information i like it.

    ReplyDelete
  4. Hi Manuel - I am running Kubuntu Feisty on an external HD. My laptop is a Dell 420. CoLinux intrigues me and I

    decided to give it a whirl. Your instructions are detailed, but I hope you could clarify a thing for me:
    Does the Linux partition need to be formatted as FAT and mounted under Windows?
    I was also hoping you could take a quick look at my colinux.conf and tell me, if I am on the right track based on my

    fstab and menu.lst file, since I am getting a kernel attack.
    Much appreciated!

    Cheers!

    ...
    VFS: Cannot open root device "sdb1" or unknown-block(8,17)
    Please append a correct "root=" boot option
    Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(8,17)
    --
    menu.lst

    title Ubuntu, kernel 2.6.20-16-generic
    root (hd0,0)
    kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=692ce111-3d47-4fe8-9eab-9ccb3d952723 ro quiet splash
    initrd /boot/initrd.img-2.6.20-16-generic
    quiet
    savedefault
    --
    fstab
    proc /proc proc defaults 0 0
    # /dev/sdb1 / ext3 defaults,errors=remount-ro 0 1
    # /dev/sdb2 /home ext3 defaults 0 2
    # /dev/sda1 /media/sda1 ntfs defaults,nls=utf8,umask=007,gid=46 0 1
    # /dev/sdb3 none swap sw 0 0
    # /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto 0 0
    --
    kernel=vmlinux



    # my swap partition

    sdb3=DeviceHarddisk0Partition3



    # my root partition

    # I usually have to play around with the partition numbers before

    # I get the final digit right.

    sdb1=DeviceHarddisk0Partition1



    # this should point to the root partition...

    root=/dev/sdb1

    ro

    initrd=initrd.gz

    mem=256



    # a slirp device for internet access; when I boot

    # kubuntu natively, this is my wired ethernet device

    eth0=slirp



    # when I boot kubuntu natively this is my wireless

    # connection; since I don't want any configuration

    # changes from native to colinux I inserted a

    # unusable eth1 device in the colinux configuration

    eth1=pcap-bridge,"Unknown"



    # internal high-speed connection between colinux

    # and vista only

    eth2=tuntap



    # I want to see my Vista files and cdrom in colinux...

    cofs0=c:

    cofs1=d:

    cofs2=e:

    ReplyDelete
  5. Tim,

    the linux partition will be mounted from colinux and thus may be formatted with every file system that colinux knows. I usually use ext3 or reiserfs.

    What is the colinux output? It's usually quite verbose when you start colinux from the command line...

    ReplyDelete
  6. Argh - I obviously forgot to escape the backslashes in my example
    configuration: It must be
    \Device\Harddisk1\Partition3

    Thanks for pointing that out (indirectly) :-)

    Cheers,
    Manuel

    ReplyDelete
  7. Aah ... that worked much better. I think I am almost there, but I have a problem logging in via ssh from cygwin (can't connect to port 22). If I boot into Kubuntu natively, I don't have a problem with ssh from my XP box using Putty.
    I assume it has something to do with the network configuration in colinux.conf or /etc/network/interfaces. I can ping 192.168.42.2 and the LAC2 on XP (TAP-Win32) shows connected.
    Would you mind taking a quick look at my two config files?

    ---

    colinux.conf

    kernel=vmlinux



    # swap partition

    sdb3=\Device\Harddisk1\Partition3



    # partitions

    sdb1=\Device\Harddisk1\Partition1

    sdb2=\Device\Harddisk1\Partition2



    # root partition

    root=/dev/sdb1

    ro

    initrd=initrd.gz

    mem=256



    # a slirp device for internet access; this is my wired connection when I boot natively

    eth1=slirp



    # when I boot kubuntu natively this is my wireless

    # connection; since I don't want any configuration

    # changes from native to colinux I inserted a

    # unusable eth1 device in the colinux configuration

    wlan0=pcap-bridge,"Unknown"



    # internal high-speed connection between colinux

    # and vista only

    eth2=tuntap



    # windows hds

    cofs0=c:

    cofs1=d:
    ---

    interfaces

    iface lo inet loopback
    address 127.0.0.1
    netmask 255.0.0.0

    auto wlan0
    iface wlan0 inet dhcp
    wireless-essid
    wireless-key s:

    auto eth2
    iface eth2 inet static
    address 192.168.42.2
    netmask 255.255.255.0

    ---

    When I do 'ifconfig' it only lists the lo interface - no eth2.

    Cheers.

    ReplyDelete
  8. From what I see you have no eth0 in your colinux config. See my article Mobile Ubuntu Colinux Setup. If you want to use eth2, you need an eth0 and eth1 as well. You can simply issue

    eth0=pcap-bridge,"Unknown"

    This will create a "dummy" eth0 device. You won't need this line for wlan1 - it's really only a placeholder because colinux doesn't support using eth2 without eht0 and eth1.

    ReplyDelete
  9. Great. I varied from your instructions, because I thought I had to get my

    wlan device in the configuration file. I got everything working now ...
    almost! My syslog reports several entries like this (each time I use coLinux):

    Jul 17 14:30:39 d420 -- MARK --
    Jul 17 14:33:27 d420 kdm: :0[3744]: IO Error in XOpenDisplay
    Jul 17 14:33:27 d420 kdm[3739]: X server for display :0 terminated

    unexpectedly
    Jul 17 14:33:27 d420 kdm[3739]: Display :0 cannot be opened
    Jul 17 14:33:27 d420 kdm[3739]: Unable to fire up local display :0;

    disabling.

    ... so I end up with only a Xterminal window in Ximg and not the KDE

    desktop.
    I found some reference that recommended to disable the opening of a local

    window, but I am hesitant to do that

    (http://colinux.wikia.com/wiki/Ubuntu61; see XDMCP). Afterall I want to be

    able to boot Kubuntu natively and through coLinux.
    Did I miss a step in your instructions?! How did you get it to work?

    BTW, shouldn't the konsole.bat read "cd cygwin\bin" instead of "cd

    cygwinbin"?

    Again, thanks for your help!

    Cheers.

    ReplyDelete
  10. I'm not using kdm (I don't know if this is easily possible when you use a non-local X server). I use Xming in multi window mode and just fire up a konsole and kate or kdevelop via those ssh scripts whenever I need them.

    Thanks for your feedback.

    ReplyDelete
  11. Try using XDM, dont use KDM or GDM since they require a local X server running, in case you use XDM you can disable local X servers (running inside colinux) and just use Cygwin (there is a .bat file startxdm.bat inside the Cygwin directories; search for .bat files)

    With XDM you connect and you will have your login screen. Other suggestions is to use Fluxbox as window manager, so you have all Linux power but without so much memory demand.

    ReplyDelete
  12. TriPhone Blog...

    You have made a good site, hoodia patch oprah, D, how long does hydrocodone stay in system, qdbdh, hoodia slimquick, %[, medical insurance billing jobs,: D, 366buy hydrocodone mexican pharmacy, 8-]]], hoodia gordonii oprah, 8), are hoodia diet pills sa...

    ReplyDelete
  13. L2YqQm fasfs fsf safsafasf afsfsafas

    ReplyDelete
  14. California Group Medical Practice...

    [...] are behind dyskeratosis congentia aging syndrome'', ''http://www.news-medical.net/?id=40388'')); Home > Newsletter > Medical A to Z > Institutions > Archives > Information > Legals > Books > Child Health > Disease [...]...

    ReplyDelete
  15. Howdy! I saw your post on a Google search... technically, CoLinux isn't a usermode Linux kernel. It actually does run in kernel space, and if you're not careful, it can very easily bluescreen your Windows session. CoLinux actually has a kernel mode driver, linux.sys, that allows it to run faster than as a usermode Linux. (If you've ever tried User Mode Linux on Linux, you will know that it's REALLY slow, compared to a native build!) You may have noticed (or not...) that you can't install CoLinux as a regular user; you need administrative privileges to install CoLinux so that the kernel mode part installs.

    It's a good thing the CoLinux developers made the port (of Linux) fairly secure. Of course, anyone who has root to your colinux virtual machine can potentially wreak havoc on your Windows box, so you'd better be careful!

    ReplyDelete
  16. #14 here again. I forgot to mention, if anyone has access to any part of the kernel of CoLinux, it's possible to get in to the kernel of Windows, too. That means, don't let anyone touch /proc/kcore, /dev/mem, /proc/iomem, /proc/interrupts, /proc/ioports, ... I think you get the idea. A maliciously crafted kernel module, or in fact, anything that can access kernel space of CoLinux has potential to access the kernel space of Windows. So, although CoLinux is a great tool for learning Linux, or even running production apps, one should always be very cautious. And of course, never give out access to your Colinux system if you value your Windows host ... unless you completely trust your users.

    ReplyDelete
  17. Hi, Klimek.
    I want to use colinux to boot fedora9 I installed in my harddisk. I use "fdisk -l" to confirm the partition for linux, They are hda8 and hda9. And the partitions are 5, 6 under windows XP.
    I edit the config file as below:
    #########################
    kernel=vmlinux
    root=/dev/hda8
    initrd=initrd.gz
    mem=512
    hda8=\Device\Harddisk0\Partition5
    hda9=\Device\Harddisk0\Partition6
    #########################
    I type "colinux-daemon.exe @harddisk.conf -t nt" to run colinux but there was some problems.

    ........
    Trying to move old root to /initrd ... /initrd does not exist. Ignored.
    Unmounting old root
    Trying to free ramdisk memory ... okay
    colinux: Linux VM terminated
    colinux: terminated with code 3 - abnormal exit, aborting

    D:\Program Files\coLinux>console: Monitor2732: Detached

    My harddisk is SATA, Windows XP SP3, Fedora 9, colinux 0.8, only one harddisk.

    I don't know where is the error, pls help me, thank you!

    ReplyDelete
  18. This post gave us a major Brainstorm session of all the possibilities we can utilize on our blog.

    ReplyDelete
  19. We have been selling only the best Male Enhancement Pills from across the globe, and we are here 24/7 to help you and give you practical advice on which of our methods will best suit your needs.

    ReplyDelete
  20. All Good Websites ANIMAL MOVIES , [url=http://justiceforcyprus.com/post57532.html#57532]ANIMAL MOVIES[/url] , http://justiceforcyprus.com/post57532.html#57532 - ANIMAL MOVIES ,
    ANIMAL PORNO , [url=http://www.h2o.ro/forum/showthread.php?p=126965#post126965]ANIMAL PORNO[/url] , http://www.h2o.ro/forum/showthread.php?p=126965#post126965 - ANIMAL PORNO ,

    ReplyDelete
  21. quick car insurance quote...

    If you’ ve ever invited an agent into your home for a car insurance price quote, only to find he doesn’ t leave until well after your bedtime, you’ ll appreciate an online quote. Everyone that’ s dealt with insurance agents at one time or another has h...

    ReplyDelete
  22. All Good Websites http://community.opennetcf.com/members/nude-celeb.aspx nude celeb , (http://community.opennetcf.com/members/nude-celeb.aspx - nude celeb) ,
    http://neatco.com/forum/user/profile.aspx?userid=27440 Eva Mendes Nude Scenes , (http://neatco.com/forum/user/profile.aspx?userid=27440 - Eva Mendes Nude Scenes) ,

    ReplyDelete
  23. Very Good Sites http://numismata.org/SMF/index.php?topic=40558.0 WWW TAIWAN SEX COM ,
    http://numismata.org/SMF/index.php?topic=40536.0 ZOO ANIMAL SEX TUBE ,
    http://forum.velovert.com/PORNO-EBONY-SEX-TUBE-m118697.html PORNO EBONY SEX TUBE ,
    http://numismata.org/SMF/index.php?topic=40568.0 PORN TUBES ,
    http://www.cgenetwork.com/forums/index.php/user/62484-porno-lesbian-sex-tube/ PORNO LESBIAN SEX TUBE ,
    http://numismata.org/SMF/index.php?topic=40545.0 RUSSIAN SEX XXX FREE ,
    http://numismata.org/SMF/index.php?topic=40534.0 RED TUBE SEX ,
    http://www.forodemodding.com/index.php?topic=268144.0 VIRGIN SEX STORIES ,
    http://forum.velovert.com/PORNO-FETISH-SEX-TUBE-m118698.html PORNO FETISH SEX TUBE ,
    http://www.forodemodding.com/index.php?topic=268154.0 ORAL PICTURE SEX TECHNIQUE ,

    ReplyDelete
  24. http://offtopics.com/welcome-center/331484-jessica-biel-nude.html#post340835 - JESSICA BIEL NUDE -
    http://www.pommo.org/community/viewtopic.php?pid=18954#p18954 - JULIETTE LEWIS NUDE -
    MARIAH CAREY NUDE ( http://www.nashville.net/profile/MARIAHCAREYNUDE - MARIAH CAREY NUDE ) ,
    SEVERINA VUCKOVIC PORNO ( http://www.pommo.org/community/viewtopic.php?pid=19006#p19006 - SEVERINA VUCKOVIC PORNO ) ,
    ELISHA CUTHBERT NUDE ( http://offtopics.com/welcome-center/331464-elisha-cuthbert-nude.html#post340815 - ELISHA CUTHBERT NUDE ) ,
    AMY ADAMS NUDE ( http://www.pommo.org/community/viewtopic.php?pid=19015#p19015 - AMY ADAMS NUDE ) ,
    http://offtopics.com/welcome-center/331483-brooke-burke-nude.html#post340834 - BROOKE BURKE NUDE -
    MILEY CYRUS NUDE ,
    http://www.pommo.org/community/viewtopic.php?pid=19011#p19011 - amanda tapping nude -
    JENNY MCCARTHY NUDE ,
    MILEY CYRUS SEX ,

    ReplyDelete
  25. ffm anal ,*
    [url=http://www.bistriskisplet.net/forum/topics/cartoon-gif-sex]CARTOON GIF SEX[/url] *
    http://hustlenomics.ning.com/forum/topics/sexy-lesbians-video - sexy lesbians video *,
    http://hustlenomics.ning.com/forum/topics/adult-xxx-tube - ADULT XXX TUBE *,
    http://www.bistriskisplet.net/forum/topics/free-online-porn-movies - FREE ONLINE PORN MOVIES *,
    LONG SEX TUBES , *
    PORN VIDEOS MATURE ,*
    canadian porn tube , *
    home sex videos , *

    ReplyDelete