
Using multiple operating systems simultaneously with colinux, Virtual PC, and Desktops
Preamble:
Recently, I have to write a little code, and there is a need to test the results of its work on different platforms. Naturally, I use virtual machines.
Since, besides me, my wife also uses my laptop, the main OS on it is winxp. In principle, I don’t care what to work with, so let windows be ...
Previously, when I used IceWM as a window manager, I liked the fact that I can use several “desktops” to launch various thematic applications in a separate place reserved for them. There is such an opportunity under windows too, but those utilities that I tried had some or other shortcomings, so sooner or later I had to give them up ... In the end, I settled on Desktops (from sysinternals) she, too, is not without flaws, but the stability of her work and the small size outweighed all the "cons".
Goal:
What are we trying to achieve:
- run on each of the "desktops" on a separate operating system
- make switching between them as convenient and fast as possible
We will need:
coLinux can be downloaded here (required to run linux kernel under windows OS)
Virtual PC can be downloaded here (required to run windows OS under windows :)). You can use other virtual machines (at home I use VirtualBox , at work Virtual PC) this is not important, but the article will discuss Virtual PC.
linux distribution (hereinafter I will talk about Slackware 12.2, because I use it)
Putty can be downloaded here to access our virtual machine via ssh
Xming; download here ; it is needed to run graphical linux applications via the X11 protocol.
Installation itself
Desktops
To begin, install Desktops, everything is simple and clear with it - download, unpack, launch,

It seemed to me that it is most convenient to set a win-digit as a hotkey for switching between “tables”.
Virtual pc
The installation process itself is also simple: download, run the installer, then install the desired operating system inside Virtual PC. There is only one nuance that I wanted to pay attention to ... In order for the win-digit not to be intercepted by the guest system, you need to configure the keyboard settings as shown in the screenshots.
Virtual PC Console ... menu item File \ Options

Next, select the Keyboard section.

After installing these settings, we can easily switch from the guest system by win-digit to the desired "desktop"
Install coLinux
We move on to a more complex topic - installing the linux distribution inside coLinux.
First you need to install coLinux and.
During the installation of coLinux, you will need to uncheck the Root Filesystem image (Download) checkbox , since we will download the desired image later. coLinux must be installed in c: \ colinux Next, you need the Linux Slackware 12.2 distribution image. You can take it from one of the working “mirrors” (http://slackware.com/getslack/), you need to download the dvd image and place it in the c: \ colinux \ linux \ directory with the file name slack12.iso.
Next, you need to create empty files to connect them as drives.
c: \> fsutil.exe file createnew c: \ colinux \ linux \ hda.img 7,000,000,000
c: \> fsutil.exe file createnew c: \ colinux \ linux \ hdb.img 3,000,000,000
c: \> fsutil.exe file createnew c : \ colinux \ linux \ swap.img 300000000
Now you need to create a file with the coLinux launch options in the c: \ colinux \ directory - for installing Slackware install.conf directly
kernel = vmlinux
hda = c: \ coLinux \ linux \ hda.img
hde = c: \ coLinux \ linux \ swap.img
hdd = c: \ coLinux \ linux \ slack12.iso
root = / dev / ram load_ramdisk = 1 prompt_ramdisk = 0 ramdisk_size = 10000
initrd = initrd.img
mem = 256
For the subsequent installation of Slackware, during the first run of coLinux, you will need the initrd.img file, it is located inside the downloaded distribution image. To extract it from there, you can use the 7zip archiver or winrar. Unpack it into the c: \ coLinux \ linux \ directory
Install Slackware
After everything is prepared, you need to start the linux installation. From the c: \ coLinux \ directory, execute the following command:
colinux-daemon.exe -t nt install .conf
A prompt appears to select a keyboard layout and enter a username, you can press enter 2 times. Next, connect the linux distribution disk
mount / dev / hdd / floppy
We connect swap section
mkswap / dev / hde
swapon / dev / hde
Format and mount the main section for installing linux.
mkfs.ext2 -j / dev / hda
to the question Proceed anyway? (y, n) need to answer y
mount / dev / hda / mnt
Next, you need to install the necessary packages
cd / floppy / slackware
installpkg -root / mnt ./a/*.tgz ./ap/*.tgz ./d/*.tgz ./f/*.tgz ./l/*.tgz ./n/* .tgz
After installing all the packages, you need to edit the file / mnt / etc / fstab so that on subsequent download all partitions will connect correctly.
You can edit the file like this
nano / mnt / etc / fstab
inserting the following lines
/ dev / hda / ext3 ro, noatime 2 2 / dev / hdb / home ext3 rw, noatime 2 2 / dev / hdd / media / dvd iso9660 defaults 0 0 / dev / hde swap swap defaults 0 0 proc / proc proc defaults 0 0 devpts / dev / pts devpts gid = 5, mode = 620 0 0
After saving the file, turn off the virtual machine with the command:
poweroff
Running coLinux as a service
Now you need to create a file with the standard coLinux launch options in the c: \ colinux \
slack.conf directory
kernel = vmlinux
hda = c: \ coLinux \ linux \ hda.img
hdb = c: \ coLinux \ linux \ hdb.img
hdd = c: \ coLinux \ linux \ slack12.iso
hde = c: \ coLinux \ linux \ swap. img
root = / dev / hda
ro
initrd = initrd.gz
mem = 128
cocon = 120x40
eth0 = tuntap
Next, run the installed Slackware for the first time
colinux-daemon.exe -t nt slack .conf
If everything went well and the OS boots, you must place the following line at the end of the / etc / profile file.
export LANG = ru_RU.UTF-8
so that we use UTF-8 as the locale.
It is also necessary to configure the IP address of the guest system, in the file /etc/rc.d/rc.inet1.conf you need to set the IP address, mask and default gateway.
IPADDR [0] = "192.168.0.2" NETMASK [0] = "255.255.255.0" GATEWAY = "192.168.0.1"
Reboot
reboot
and run the installed Slackware as a windows service
cd c: \ colinux
colinux-daemon.exe --install-service colinux slack .conf
net start colinux
If you manage to connect to the guest machine via ssh, then you can move on ...
Install Xming Xming Server
Installing and configuring Xming is pretty simple, but there are a number of not obvious points that I would like to dwell on ...
- The first point is the options for starting the X server
- The second is connecting fonts
Now more ...
Font connection
If you, like me, want to see and be able to enter Russian text, then you will need to install Cyrillic fonts. To do this is quite simple, just run in the font directory:
mkfontdir
mkfontscale
the above utilities can be taken from the cigwin kit , or you can simply copy the entire font directory to the linux machine and execute these commands there.
Font directories must be written in the file C: \ Program Files \ Xming \ font-dirs
Creating an X Server Connection
To specify which keyboard layouts will be used and how to switch between them, you must specify them as parameters.
If you need 2 keyboard layouts - Russian and English, and switching by Alt-Shift, then the options will be like this:
-xkblayout us, ru -xkbvariant basic, winkeys -xkboptions grp: alt_shift_toggle
The screenshots show how to run the X-server on a separate “desktop”. We





save the Xming settings file and make a shortcut on the desktop to start it.
Putting it all together ...
So we have 4 "desktops"
- on the first we will launch "native" applications
- on the second, we’ll have the guest virtual OS windows deployed in full screen (I need it for all kinds of inhuman experiments)
- on the third full-screen X-server with linux
After loading the machine, switch to the second “desktop” (press win-2), launch Virtual PC in full screen. Next, switch to the third “desktop” (press win-3) and run the shortcut to connect to lixux via Xming ...
Now, to switch from windows to linux, just click win-3 to get to the guest machine with windows, click win-2, to return to the main work, click win-1. At the same time, everything works in parallel and you can return to the desired OS at any time.
This is how it looks with me:
(first and third “desktops”)


PS:
You can read about how to configure putty as a tunnel for X11 here quite intelligibly and clearly stated ...UPD: use VirtuaWin instead of Desktops