Qemu providing access to folder as fat32 drive

About Qemu-system-ppc, a PPC Mac emulator for Windows, macOS and Linux that can run Mac OS 9.0 up to Mac OS X 10.5

Moderators: Cat_7, Ronald P. Regensburg

Post Reply
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Qemu providing access to folder as fat32 drive

Post by Cat_7 »

Qemu can access a folder on the host as a vfat drive by using e.g., this command line in Windows:

-drive file=fat:rw:c:\Exchange,format=raw,media=disk

When you add an entry like that, the command line shows:
vvfat c:\Exchange chs 1024,16,63

This works wonders in PPC OSX for easy file exchange. An additional disk called QEMU VVFAT appear at the desktop. OSX says about the disk: Capacity 503.7MB, format is Macintosh PC Exchange (MS-DOS)
But OS 9 doesn't load the drive at boot. In drive setup I see the drive listed a <DOS volume> but I cannot access it.

Foreign file access CP etc are installed in OS 9.

Any ideas?

ps: I tried this in OSX with -drive file=fat:rw:/Volumes/Sierra/Users/username/Exchange,media=disk,format=raw and the disk shows up on the desktop. But as soon as I try to copy something onto it, qemu crashes.

Best,
cat_7
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Qemu providing access to folder as fat32 drive

Post by Cat_7 »

I now found a way to add a folder as fat32 drive to Mac OS 9.2 through the usb-storage feature (in Windows):

-device usb-storage,drive=fat32 -drive file=fat:rw:c:\Mac-disks\Exchange,id=fat32,format=raw,if=none

This would _in theory_ add a folder for easy file exchange. But copying to the "drive" results in some command line errors and occasional windows errors (which can sometimes be dismissed by selecting "ignore"). It seems files can be copied to the "drive" but they do not show up on the host side. They can, however, be used on the guest side ;-) but are not persistent over reboots.

Best,
Cat_7
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Qemu providing access to folder as fat32 drive

Post by adespoton »

well, that beats having to make a disk image of a folder and mount it... I've had the opposite issue mounting vdi/qcow images on the host. I can pull stuff off of them, but anything I put on them doesn't show up when mounted in the guest.

I suppose between those two, we've got a slow and hacky solution, at least on Windows?
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Qemu providing access to folder as fat32 drive

Post by Cat_7 »

This also "works" on OSX, but it is quite buggy on both platforms.

It seems the current code isn't really tested, but might get improved if we think this feature is worthwhile.

-drive file=fat:rw:fat-type=16:c:\Mac-disks\Exchange,id=fat32,format=raw,if=none

Get you a bit further. At least in Windows files added to the vvfat drive on the guest appear in the designated folder on the host.

Best,
Cat_7
WizKid
Tinkerer
Posts: 72
Joined: Sun Jul 31, 2016 11:58 pm

Re: Qemu providing access to folder as fat32 drive

Post by WizKid »

Cat_7 wrote: Sat May 27, 2017 4:26 pm This also "works" on OSX, but it is quite buggy on both platforms.

It seems the current code isn't really tested, but might get improved if we think this feature is worthwhile.

-drive file=fat:rw:fat-type=16:c:\Mac-disks\Exchange,id=fat32,format=raw,if=none

Get you a bit further. At least in Windows files added to the vvfat drive on the guest appear in the designated folder on the host.

Best,
Cat_7
Just tried with the latest qemu build.

My coomand is:

Code: Select all

./qemu-system-ppc-screamer -L pc-bios -boot c -M mac99,via=pmu -m 512 -prom-env 'auto-boot?=true' -prom-env 'boot-args=-v' -prom-env 'vga-ndrv?=true' -rtc base=localtime -bios openbios-ppc -drive file=fat:rw:/Volumes/RAM,id=fat32,format=raw,if=none
But opening the File Exchange control panel and click "Mount Now" gives the error:
The disk could not be mounted.

Make sure the disk uses a PC format and that it is properly connected to your computer and turned on. If the disk still can't be mounted, restart your computer. You may need to contact the disk's manufacturer to update its software.
Would an unformatted vmdk work?
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Qemu providing access to folder as fat32 drive

Post by Cat_7 »

You can give something like this a go:
-device usb-storage,drive=fat32
-drive file=fat:rw:c:\QemuVVFAT,id=fat32,format=raw,if=none
Would an unformatted vmdk work?
The point here is that the command should let a local folder appear as a drive on the desktop.

Adding a vmdk type disk can be done with the regular commands. https://superuser.com/questions/753024/ ... h-qemu-img

Best,
Cat_7
WizKid
Tinkerer
Posts: 72
Joined: Sun Jul 31, 2016 11:58 pm

Re: Qemu providing access to folder as fat32 drive

Post by WizKid »

Well it seems like it's an either/or situation.

When the "Apple Audio Extension" is enabled, it causes an illegal instruction system bomb at startup and the terminal gets spammed with "Invalid file name" errors.

Without the added parameters to get the shared folder, there's no illegal instruction error but there's no sound (since once has to disable it).
User avatar
Ronald P. Regensburg
Expert User
Posts: 7821
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Qemu providing access to folder as fat32 drive

Post by Ronald P. Regensburg »

Is the 'Apple Audio Extension' needed in MacOS in Qemu? In SheepShaver, if it happens to be installed (not with a default installation), it is best removed because of possible crashes. Sound works there fine without the extension.
WizKid
Tinkerer
Posts: 72
Joined: Sun Jul 31, 2016 11:58 pm

Re: Qemu providing access to folder as fat32 drive

Post by WizKid »

Ronald P. Regensburg wrote: Sat Nov 07, 2020 4:21 pm Is the 'Apple Audio Extension' needed in MacOS in Qemu? In SheepShaver, if it happens to be installed (not with a default installation), it is best removed because of possible crashes. Sound works there fine without the extension.
Just checked. No, it's not required per se, but's it's required if you want to use the Sound control panel to adjust the volume and audio sources
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Qemu providing access to folder as fat32 drive

Post by Cat_7 »

the terminal gets spammed with "Invalid file name" errors.
Yes, that sometimes happens and sometimes does not. Up to now I've only had success when putting files in the folder and then start Qemu. I have also been able to copy simple text files from Qemu to the folder. But the folder content should not be changed from the host side while Qemu is running...

In Mac OS the drive is seen as a PC-exchange drive, which seems appropriate. Is there not a Mac PC-exchange tool that might help in moving files into the drive correctly? I haven't tested it with a screamer build.

But please note you are experimenting: the screamer is experimental and the vvfat drive does not seem to be developed for Windows/OSX hosts in relation to qemu-system-ppc.

Best,
Cat_7
win.exe
Tinkerer
Posts: 42
Joined: Tue Apr 07, 2020 4:59 pm

Re: Qemu providing access to folder as fat32 drive

Post by win.exe »

Yes, what Cat_7 said. The screamer builds are experimental and might cause problems which is why they are deemed experimental.



Best,
win.exe
User avatar
tkahn
Space Cadet
Posts: 2
Joined: Fri Jan 07, 2022 7:26 pm

Re: Qemu providing access to folder as fat32 drive

Post by tkahn »

Cat_7 wrote: Thu May 25, 2017 9:22 pm This works wonders in PPC OSX for easy file exchange. An additional disk called QEMU VVFAT appear at the desktop. OSX says about the disk: Capacity 503.7MB
Why is the disk so small? FAT32 should be able to hold volumes up to 4GB?
This is a problem when trying to get larger files into Qemu running MacOS 9.

/Thomas
Post Reply