星期二, 二月 20, 2007

colinux共享win下目录

发现我的英文水平确实忑差,唉,读了半天才弄懂colinux设置和win共享。无奈~
其实不难,按照colinux的说明,要先配置cofs,所谓的cofs就是和win共享的win下磁盘目录。可以用如下方法挂载win下的文件到cofs。
可以在配置文件添加如下
" path="\DosDevices\" enabled="true">
index="*",这个为设备数目,我共有三个设备,分别为root.fs的ext3文件系统,swap.fs交换分区,以及一个挂载的光驱,所以这里我的*为4,colinux最多可支持31个设备,type我选择的是meta,path为共享路径。
具体关于type的选项可参考原文

cofs is similar to UML's hostfs. It is a binding between the host's
VFS and Linux's VFS layers. By using cofs it is possible to mount
host OS directories inside Linux.

* Flat mode (default)

Mounting in flat mode (the default) under Windows, means that the
expected behavior of the mounted file system is similar to that of
vfar or samba, which means there is no support for the regular
UNIX meta data and all the UNIX attributes (mode, uid, gid) are
virtually the same for all files and directories. Creation of special
files like symlinks, device nodes, and pipes are not supported.

* UNIX meta data mode

Future versions of cofs support will introduce the UNIX meta data
mode, which is similiar to hostfs. It will allow to have a true
UNIX file system on top of a Windows (or Linux) file system by
storing the VM's UNIX meta data as regular inaccessible files.
Theoretically, it will allow to boot a full Linux system without
a root file system image.

* Ports

For the host OS side, cofs is only supported on the Windows port
at the time this is written (October 23, 2004).

The planned Linux port will be designed to behave more like UML's
hostfs in flat mode (with support for UNIX attributes), and UML's
humfs in UNIX meta data mode.


第二种添加cofs方法是在cmd下运行colinux时加载启动参数:cofs*=host-pathname

如此启动后,挂载cofs到/mnt目录
mount -t cofs cofs4 -o uid=dax,gid=dax /mnt/share

这样即可共享win目录了。
之所以要共享win目录,我那天晚上突然想到了虚拟机嵌套虚拟机,刚好有个win98的qemu磁盘镜像,于是在colinux下的debian系统里安装了qemu,然后将win下的win98.img这个qemu磁盘镜像共享给了debian。总算领略到了虚拟机里玩虚拟机的趣味,嘿。
截图为 WinXP(实机)->Debian(colinux虚拟机)->Win98(QEMU虚拟机)

PS:好玩的是我给colinux分配了128M内存,但是我可以再次给qemu分配256M的内存,不错~

没有评论: