BSD DevCenter
oreilly.comSafari Books Online.Conferences.

advertisement


Running Windows Applications on FreeBSD
Pages: 1, 2, 3

Before adding a permanent mount entry to /etc/fstab, I'll ensure that I can first manually mount that partition without any errors:



mount -t msdos /dev/ad0s1 /dos

Note that I specified the filesystem type with -t msdos, the partition's name with /dev/ad0s1 and the mount point with /dos. Because I just received my prompt back, the mount was successful -- I can verify this with the df command:

df -h
Filesystem   Size   Used  Avail  Capacity  Mounted on
/dev/ad0s2a   97M    36M    53M    40%     /
/dev/ad0s2f  1.7G   567M   1.0G    35%     /usr
/dev/ad0s2e   19M   2.0M    16M    11%     /var
procfs       4.0K   4.0K     0B   100%     /proc
/dev/ad0s1   2.0G   783M   1.2G    38%     /dos

I can also verify the contents of the mounted partition using ls; I'll include the F switch so I can tell the directories from the files as the directories will be followed by a /.

ls -F /dos

AUTOEXEC.BAT*   COMMAND.COM*    MSDOS.SYS*      SCANDISK.LOG*
BOOT.INI*       CONFIG.SYS*     My Documents/   SETUPLOG.TXT*
BOOTLOG.PRV*    DETLOG.TXT*     NETLOG.TXT*     WINDOWS/
bootsect.bsd*   IO.SYS*         Program Files/  RECYCLED/
ntdetect.com*   ntldr*

If you've never mounted another operating system's partition before, you may want to take a few minutes to get used to cd-ing and ls-ing the contents of that partition from your FreeBSD prompt. Take note that many of the files are in uppercase -- when you wish to access a file, type it in exactly as it appears as FreeBSD is case sensitive. Also, some files have spaces in them. To access these files, you can either start to type in the name and then use your tab key to auto-complete the name, or else use a backslash to escape the space like so:

cd Program\ Files

If you want to have your Windows partition mounted for you at boot time, carefully add the following line to your /etc/fstab file:

/dev/ad0s1	/dos	msdos	rw	0	0

Make sure that you use the right partition name as yours may not be ad0s1 like mine is. Double-check that you don't have any typos before saving your changes. I always like to ensure that my changes to /etc/fstab worked, so I'll test it by typing:

shutdown now
press enter when receive prompt back, then type
exit

Once you've logged back in you can ensure that the partition is mounted by repeating the df -h command.

Now, let's edit the Wine configuration file. Use your favorite text editor to open up /usr/local/etc/wine.conf. Since the default configuration file usually doesn't require any changes to work, I've snipped most of the output to just show the bit you may have to change to match your configuration:

more /usr/local/etc/wine.conf
WINE REGISTRY Version 2
;; All keys relative to \\Machine\\Software\\Wine\\Wine\\Config
<snip>
[Drive A]
"Path" = "/mnt/fd0"
"Type" = "floppy"
"Label" = "Floppy"
"Serial" = "87654321"
"Device" = "/dev/fd0"

[Drive C]
"Path" = "/c"
"Type" = "hd"
"Label" = "MS-DOS"
"Filesystem" = "win95"
<snip>

Let's stop here as this is the part that needs to change. Replace the /c in the Path line with the name of your mount point. Since I called my mount point /dos, I changed this line to read:

"Path" = "/dos"

Save your change. I've found that this file needs to be copied to the user's home directory in order for Wine to work. Still as the superuser, I'll do the necessary changes in the user genisis' home directory:

mkdir ~genisis/.wine
chown genisis ~genisis/.wine
cp /usr/local/etc/wine.conf ~genisis/.wine/config

Note that I renamed the configuration file to config when I copied it into genisis' .wine directory. At this point, I'll exit the superuser account as my configurations are finished. As the user genisis, I'll fire up an XWindows session:

startx

Once I'm in, I'll open up an xterm window and look for a Windows application to execute:

cd /dos/WINDOWS
ls | more

I notice PROGMAN.EXE and am intrigued as that is the Windows Program Manager. I'll see if I can get it to work from FreeBSD using Wine:

wine -winver win98 -managed PROGMAN.EXE

After a few seconds, I'm greeted by Program Manager. Clicking on the File menu, I select the "Run" option and then click on the Browse button. I'm greeted by a list of all of the programs running on my Windows partition.

Pages: 1, 2, 3

Next Pagearrow





Sponsored by: