Qemu package and guide for OSX available

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

emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Qemu package and guide for OSX available

Post by emendelson »

Ronald P. Regensburg wrote:Or see my post and adespoton's reply here: http://www.emaculation.com/forum/viewto ... 036#p57036
Thank you. I saw that, but I can't trust non-technical users to know when to leave disks unmounted. I'm trying to figure out something at least as smooth as SheepShaver's Unix folder so that non-technical people can transfer files easily without mounting or unmounting disks and shutting down the emulator.
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Qemu package and guide for OSX available

Post by adespoton »

--drive file=fat:rw:fat-type=16:/Users/MYNAME/Qemudisk,id=fat32,format=raw,if=none
I presume the disk is indeed formatted FAT-16? Although I notice you're using id=fat32?

I think your problem might be with mixing up multiiple formats in your --drive flag. I generally let QEMU figure out the image format, partitioning scheme and filesystem type itself, so I've never done this; but then, I've only ever used HFS+ and FAT-32 filesystem types.
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Qemu package and guide for OSX available

Post by emendelson »

adespoton wrote:
--drive file=fat:rw:fat-type=16:/Users/MYNAME/Qemudisk,id=fat32,format=raw,if=none
I presume the disk is indeed formatted FAT-16? Although I notice you're using id=fat32?

I think your problem might be with mixing up multiiple formats in your --drive flag. I generally let QEMU figure out the image format, partitioning scheme and filesystem type itself, so I've never done this; but then, I've only ever used HFS+ and FAT-32 filesystem types.
The disk isn't formatted at all. I'm following Cat_7's suggestion for treating a folder on the host system as if it were a drive. Please see Cat_7's posts. It certainly doesn't sound from his posts as if you need a FAT-formatted drive - just a folder on the host machine. But maybe I'm completely deluded.
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Qemu package and guide for OSX available

Post by adespoton »

Ah; that *may* work, but is still experimental, and will only work if the host is Windows. And that FAT-16/Fat32 issue is likely the cause of the *may* work problems he was experiencing; some of the APIs differ between those formats, which could cause issues when reading/writing larger files.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Qemu package and guide for OSX available

Post by Cat_7 »

You'll need this version of Qemu:
http://www.open.ou.nl/hsp/downloads3/Qe ... 072017.zip

Then, for OSX hosts, give this a go:

-device usb-storage,drive=fat16 -drive file=fat:rw:fat-type=16:/Users/MYNAME/Qemudisk,id=fat16,format=raw,if=none

The designated folder of course cannot be fat16 as it is on the normal host file system. The idea is that the folder presents itself as a fat16 disk to the guest.

Best,
Cat_7
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Qemu package and guide for OSX available

Post by emendelson »

Cat_7 wrote:You'll need this version of Qemu:
http://www.open.ou.nl/hsp/downloads3/Qe ... 072017.zip

Then, for OSX hosts, give this a go:

-device usb-storage,drive=fat16 -drive file=fat:rw:fat-type=16:/Users/MYNAME/Qemudisk,id=fat16,format=raw,if=none

The designated folder of course cannot be fat16 as it is on the normal host file system. The idea is that the folder presents itself as a fat16 disk to the guest.

Best,
Cat_7
Seems to be a problem on my system: This build produced this error:
MacBook-Air-2015:~ edward$ /Emulators/Qemu/qemu-os9-boot-vfat.command ; exit;
dyld: Library not loaded: /usr/local/opt/pixman/lib/libpixman-1.0.dylib
Referenced from: /Emulators/Qemu/./qemu-system-ppc-vfat
Reason: image not found
I should probably wait for a newer build...
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Qemu package and guide for OSX available

Post by Cat_7 »

Ah yes, every build I share should first be patched wrt the locations of the dependent libraries....

I'll post something when the new code is included in the source.

Best,
Cat_7
emendelson
Forum All-Star
Posts: 1706
Joined: Tue Oct 14, 2008 12:12 am

Re: Qemu package and guide for OSX available

Post by emendelson »

adespoton wrote:Can't QEMU set up a virtual serial interface to named pipes? Seems to me we should be able to automate some sort of system where files can be sent via serial between guest and host. Maybe using ZTerm on the guest and ??? on the host?
Could you try this and let us know if it works or not? You've been posting some very interesting suggestions, and you may be the only person on the forum who knows how to put them into effect. So anything you can report about actual results would be very welcome. Thank you again.
Programmingkid
Apple Corer
Posts: 243
Joined: Sun Jan 31, 2016 6:01 pm

Re: Qemu package and guide for OSX available

Post by Programmingkid »

Cat_7 wrote:You'll need this version of Qemu:
http://www.open.ou.nl/hsp/downloads3/Qe ... 072017.zip

Then, for OSX hosts, give this a go:

-device usb-storage,drive=fat16 -drive file=fat:rw:fat-type=16:/Users/MYNAME/Qemudisk,id=fat16,format=raw,if=none

The designated folder of course cannot be fat16 as it is on the normal host file system. The idea is that the folder presents itself as a fat16 disk to the guest.

Best,
Cat_7
Thank you Cat_7 so much for this information. This allows me to share files with my Mac OS 10.4 VM with my Mac OS 10.12 guest. Best of all there are no kernel extensions or extra software required. You are a life-saver :)

The only issues I have encountered so far are files greater than 2 GB in size can't be shared with this method. Not a big deal.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Qemu package and guide for OSX available

Post by Cat_7 »

Does this work for you? Can you exchange files on the fly, or only those that are there during boot?
Are you using the downloaded version or your own more recent build?

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 package and guide for OSX available

Post by adespoton »

Also, does modifying the folder when the guests are running cause any issues?
Programmingkid
Apple Corer
Posts: 243
Joined: Sun Jan 31, 2016 6:01 pm

Re: Qemu package and guide for OSX available

Post by Programmingkid »

Cat_7 wrote:Does this work for you? Can you exchange files on the fly, or only those that are there during boot?
Are you using the downloaded version or your own more recent build?

Best,
Cat_7
Only the files that were there when I first booted the VM show up.
I am using the most recent git version.

I was able change a text document in the guest and see the changes on the host. But not the other way around.

When I tried renaming a file and QEMU crashed without warning.
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Qemu package and guide for OSX available

Post by Cat_7 »

Yes, that seems to be the status of that functionality. Not improved since my last tests.

Best,
Cat_7
Programmingkid
Apple Corer
Posts: 243
Joined: Sun Jan 31, 2016 6:01 pm

Re: Qemu package and guide for OSX available

Post by Programmingkid »

adespoton wrote:Also, does modifying the folder when the guests are running cause any issues?
Just as an experiment I started sharing a folder. When the Mac OS 10.4 guest was done booting I removed all the files from the shared folder on the host side. On the guest side nothing appeared to change from the Finder's point of view. When I tried opening these files none of them would open.

So far this looks like the easiest way to share folders between host and guest. I think using SMB or Apple Filing Protocol is the better way to do it. Changes on one side would appear on the other side. This could be useful to those who spend hours working with a VM. The only issue I have is having to install tuntaposx. Just upgrading my computer from 10.12.5 to 10.12.6 made tuntaposx stop working. I'm guessing it just needs to be reinstalled. Hopefully someone will figure out a way to just use Mac OS X's supplied software to make sharing work.
Programmingkid
Apple Corer
Posts: 243
Joined: Sun Jan 31, 2016 6:01 pm

Re: Qemu package and guide for OSX available

Post by Programmingkid »

Finally figured out how to enable AFP sharing between the guest and the host. I used a Mac OS 10.12 host and a Mac OS 10.4 guest. This kind of sharing means if a change takes place on one end, it also takes place on the other end immediately.

Sharing Recipe:

QEMU:
- Add this command-line option: -netdev user,id=mynet0,hostfwd=tcp::5555-:548 -device rtl8139,netdev=mynet0

In Guest:
- turn on File Sharing in the Sharing pane of System Preferences

In Host:
- In the Finder select Go->Connect To Sever
- Type in afp://localhost:5555
- Select Registered User
- Enter password
- Push the Ok button

This solution requires only the software that comes with Mac OS X. No additional kernel extensions or anything like that is needed. It works by using the port forwarding feature of the SLIRP networking backend.

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

Re: Qemu package and guide for OSX available

Post by adespoton »

I notice you're using the RTL device; does this work with sungem as well?

If so, this looks like it will become my new file sharing method of choice, and should work for OS 9 as well :)
Programmingkid
Apple Corer
Posts: 243
Joined: Sun Jan 31, 2016 6:01 pm

Re: Qemu package and guide for OSX available

Post by Programmingkid »

adespoton wrote:I notice you're using the RTL device; does this work with sungem as well?

If so, this looks like it will become my new file sharing method of choice, and should work for OS 9 as well :)
It does work with sungem. Here is the command-line options I used:
-netdev user,id=mynet0,hostfwd=tcp::5555-:548 -device sungem,netdev=mynet0

I tried this with Mac OS 10.4 and it worked just fine. When I tried it out using Mac OS 9.2, the results upset me. I saw an error dialog that said:

"The version of the (AFP) server you are trying to connect to is not supported."

This is definitely a political decision as oppose to a technical decision. Apple seems to like taking away features :(. It looks like someone using an older version of Mac OS X might have better luck with sharing with Mac OS 9 than me. Third party solutions might be something to look into.
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Qemu package and guide for OSX available

Post by adespoton »

That is definitely a political limitation... Mac OS 9 uses AFP over TCP, so unless the limitation has to do with encryption strength or token passing bugs, I can't quite figure out why that's in place. I know OS 9 works with 10.4 AFP, and I believe it works with 10.6 as well. So for file sharing with 10.7+, it's possible that some system that understands both versions of AFP might be needed in the middle (there's an AppleShare VM based on linux floating around that will support everything from the IIGS AppleShare through to 10.12 AFP).

However, AFP has been deprecated for a few years with CFS (SAMBA) being the preferred method. I've tried Thursby's DAVE on 9.2 though, and while it can see the modern CFS fileshares, it bombs when you try to actually use them. Sadly, FTP appears to be the file sharing method common to all (10.12 finder can still handle ftp, and Fetch works fine on 9.2 and earlier).
Programmingkid
Apple Corer
Posts: 243
Joined: Sun Jan 31, 2016 6:01 pm

Re: Qemu package and guide for OSX available

Post by Programmingkid »

Ok, I don't understand it but it was too interesting to not report. Sharing can be done without using the port forwarding feature. In my previous post I had the guest act as the server and the host as the client. Doing it in reverse made the guest the client and the host as the server. This setup didn't need the hostfwd option. The nic was setup like this: -netdev user,id=mynet0 -device rtl8139,netdev=mynet0. Nothing special. Then I simply turned on File Sharing on the host and went to 'Go->Connect to Server' in the guest. I was able to log in to the host and share the host desktop :shock:. I did several test with moving files and and creating folders. They went smoothly. Playing a few mpeg movie files in the guest even worked! I just can't believe it was so easy. I used the most recent git version of QEMU (v2.10.0-865).
Host: Mac OS 10.12
Guest: Mac OS 10.4
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Qemu package and guide for OSX available

Post by adespoton »

Does this method work for OS 9 too by chance (with sungem)?

The difference makes sense to me because of how SLiRP works; some of the interfaces are only exposed in one direction. Generally any broadcast info from the host can be made available to the guest, but the guest can't necessarily see anything not specifically sent to it by the host.

I'm guessing that OS 9 is still a no-go, but hey... you never know ;)
Programmingkid
Apple Corer
Posts: 243
Joined: Sun Jan 31, 2016 6:01 pm

Re: Qemu package and guide for OSX available

Post by Programmingkid »

adespoton wrote:Does this method work for OS 9 too by chance (with sungem)?

The difference makes sense to me because of how SLiRP works; some of the interfaces are only exposed in one direction. Generally any broadcast info from the host can be made available to the guest, but the guest can't necessarily see anything not specifically sent to it by the host.

I'm guessing that OS 9 is still a no-go, but hey... you never know ;)
Haven't succeeded yet. I enabled AFP sharing in the Sharing pane of the host's System Preferences. Then I went into Mac OS 9.2 and opened the Chooser application. It didn't see the Mac OS X shares :(. Mac OS 10.12's AFP version is much newer than what Mac OS 9.2 has available to it so I am not surprised.
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Qemu package and guide for OSX available

Post by adespoton »

Yeah; likewise I've had no luck getting OS X AFP to show up in OS 9's Chooser... how about using the File Sharing control panel in OS 9 and connecting to the IP from the host? I just get "There is a problem connecting" when I try, but I don't think I've got it configured correctly to route through the SLiRP connection.
User avatar
mabam
Master Emulator
Posts: 497
Joined: Wed Apr 10, 2013 9:32 am

Re: Qemu package and guide for OSX available

Post by mabam »

There is a solution: Make AppleTalk work on macOS using netatalk (port Linux kernel AppleTalk to a .kext for macOS/OS X first) or CAP (port the whole thing to macOS/OS X).

Someone opened a thread about that earlier :mrgreen:
http://www.emaculation.com/forum/viewtopic.php?t=8589


EDIT:
Wait …
We're speaking about an older version of AFP with TCP/IP as transport layer here. netatalk 2.0.5 via macports offers that functionality without the need of AppleTalk in the kernel.
I don't know whether it installs (it didn't when I was trying to install it as reported in above mentioned thread, but I don't understand much about that anyway), but it should be compatible with Mac OS 9.


EDIT 2:
I just tried installing netatalk via macports again. It doesn't compile on my system, but a little searching brought up that Mountain Lion just seems to be too old for macports to successfully install netatalk.
It should work on present macOS systems, though. Would be interesting to hear reports on that here.
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: Qemu package and guide for OSX available

Post by adespoton »

Older versions of netatalk do work on Mountain Lion; I started using netatalk with Snow Leopard, and stopped using it with Mountain Lion.
User avatar
mabam
Master Emulator
Posts: 497
Joined: Wed Apr 10, 2013 9:32 am

Re: Qemu package and guide for OSX available

Post by mabam »

I also just tried in my Sierra VM. There building netatalk via macports also fails. And in my Snow Leopard VM I can't get macports to work.
Post Reply