[ Saturday, 2 August 2008, MAcks ]
If you ever: needed to access your ext3, reiserfs or XFS partitions from Windows, wanted to use one of your favorite file systems via FUSE, or had an idea to mount an image of your hard drive, then this article is for you. This is a how-to, describing what to do, if you want Windows to handle file systems in a similar way as Linux does.
For our task we will use coLinux. coLinux is a modified linux kernel that can be executed as an application or a service in the Windows environment. The web page of the project is http://www.colinux.org/.
The installation procedure was tested on the stable version of the coLinux project (as of 28.06.2008). Installation was performed on the Windows 32-bit architecture. As far as other operating systems are concerned, there might be some modifications needed.
In short, we install coLinux on a windows machine, assure access to disk partions, and export all the mounted file systems using Samba.
Windows Vista users have to run the commands (e.g.,
cmd.exe, setup) via the context menu “run as …”. It is important, that while doing that, they are in the administrators mode.
Get ready for the installation
- Download the program from the projects website (v0.7.3), and
install it in the
- Edit the connection settings of the virtual ethernet card installed by the coLinux (TAP Win32 Adapter V8 (coLinux)).
In the TCP/IP settings, set: IP address: 192.168.37.10 Subnet Mask: 255.255.255.0
- Download Ubuntu-7.10.ext3.2GB.7z image from the the project’s webpage, and extract it to
- The swap file comes together with the image so the next step can be omitted
- (Optional) If really needed, this command will create a 128MB swap:
fsutil file createnew c:\coLinux\swapp128.fs 134217728(one also has to run
mkswapin Linux, and make sure that there is a corresponding line in
- Change of filenames:
- Copy example.conf to ubuntu.conf
- Edit of
ubuntu.conf, by inserting these in proper places:
ubuntu-start.cmdwith the following content:
colinux-daemon.exe -t nt @ubuntu.conf
- Login as root with the default “root” password
- Change the root password (
editor /etc/network/interfacesand add:
auto eth1iface eth1 inet staticaddress 192.168.37.20network 192.168.37.0netmask 255.255.255.0broadcast 192.168.37.255
ping 192.168.37.10(from Linux to Windows) it should work now
editor /etc/apt/sources.list(replace gutsy with hardy in all the paths)
aptitude install samba openssh-server mc fuse-utils
#at the beginning of the line
- Add a new user:
adduser user1(from now on, you can ssh to this account)
adduser user1 fuse(this allows the user to use FUSE)
- Check if you are able to establish a ssh connection with 192.168.37.20 in Windows
- Halt Linux:
How to mount the file system?
- Search for the partition you want to mount.http://colinux.wikia.com/wiki/Partitions.In my case, it is
ubuntu.confagain, and insert the following
# partition to be mountedcobd2="\Device\Harddisk2\Partition2"
- Login as root
/dev/cobd2 /media/cobd2 ext3 defaults 0 0to
fstab(it is an ext3 partition in my case).
How to share file systems via Samba?
- Should you want to share a whole file system with user1, you must give him read and write permissions.(
- After setting the permissions, add at the following, at very end of
[my data]path = /media/cobd2valid users = user1read only = no
- Add the user to the password’s database of samba:
smbpasswd -a user1(samba does not use the system accounts by default)
- Type the address in Windows
\\192.168.37.20, and login as user1 using the password generated by
smbpasswd. You can map this file system to a “letter” in your OS
FUSE-based file systems
To use the FUSE file systems (e.g., sshfs, encfs, …), you have to mount them using the
allow_other option (which should be enabled in
/etc/fuse.conf).How to mount:
encfs $WHAT $WHERE -- -o allow_othersshfs $SERVER:$PATH $WHERE -o allow_other
- To make, connecting to coLinux, easier add the IP address to
- If you don’t want to start coLinux manually, it can be installed as a service:
colinux-daemon.exe --install-service colinux @ubuntu.conf
When running coLinux as a service, you can use the following commands to control it:
net start colinuxnet stop colinux
- You can also set this service to start automatically. By doing so, you will get access to the mounted file systems immediately after the OS starts (provided that the disk was was mapped to be automatically mounted). One can access coLinux via a console (all of them are installed in
C:\coLinux) or via ssh.
- If you want to have the same data under Windows and Linux, you have to sync the UID numbers (in
/etc/passwd) of the user, who handles the files under Linux and coLinux.
This solution does not provide an outstanding performance, but the benefits compensate for it. I’ve obtained transfers of up to 5 MB/s on an Athlon XP 2000+, SATA disk and an ext3 file system. Any ideas, on how to improve these results, are welcome.
Subscribe to RSS feed for this article!