Probably missing something obvious. Mounting? sharing files?

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
Jon God
Inquisitive Elf
Posts: 28
Joined: Fri Aug 05, 2011 6:18 am

Probably missing something obvious. Mounting? sharing files?

Post by Jon God »

[Mac OS X 10.14]
So I got QEMU working with a qcow2 image, but I realized a few things:

• I don't know how to mount or convert a qcow2 imagine into something I can mount.
• I haven't figured out how to mount other hard drives.
• I can't seem to find a way to get files in and out of QEMU for working.

I am quite a newbie when it comes to running stuff through terminal, so it's unsurprising if I am missing syntax or something else obvious.

Any help on any of the above issues would be wonderful! thank you!
User avatar
Cat_7
Expert User
Posts: 6172
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Probably missing something obvious. Mounting? sharing fi

Post by Cat_7 »

Hi,

You can convert a qcow2 image to a raw image which you should be able to mount in OSX.
Syntax for the command line is:
./qemu-img convert -f qcow2 -O raw diskname.qcow2 diskname.img

Note that the advantage of the image only taking up the space of the actual size of the data contained on it is lost. A raw image will take up all space that was allotted to it on creation.

You can then add the disk to qemu by adding a drive to the qemu.command file like this:
-drive file=diskname.img,format=raw,media=disk

As you should be able to mount the disk image in OSX, that is also the way to get files in/out the image to/from your host. Note you should never have the disk image you use to exchange files mounted in OSX when starting Qemu. And also not the other way around: do not mount the exchange disk in OSX when it is open in Qemu.

EDIT: On second thought it might be better to leave your system disk (the qcow2 one) intact and create a new disk image for the exchange only.

Creating a new disk image goes like this:
./qemu-img create -f raw -o size=2G exchange.img

Then add that to the command line:
-drive file=exchange.img,format=raw,media=disk

Note that any new disk should first be initialized with the Drive setup program in Mac OS, just like on a real Mac.

Best,
Cat_7
Last edited by Cat_7 on Sun Aug 02, 2020 6:14 am, edited 1 time in total.
Reason: edited to add the second option about an additional disk image
Jon God
Inquisitive Elf
Posts: 28
Joined: Fri Aug 05, 2011 6:18 am

Re: Probably missing something obvious. Mounting? sharing fi

Post by Jon God »

I've tried a few things, and I am unable to get anything other than the first drive to mount

my current qemu.command is this:

Code: Select all

#!/bin/bash
cd "$(dirname "$0")"

./qemu-system-ppc  -L pc-bios -boot c -M mac99,via=pmu -m 256 \
-prom-env 'auto-boot?=true' -prom-env 'boot-args=-v' -prom-env 'vga-ndrv?=true' \
-drive file=disk.qcow2,format=qcow2,media=disk 
-drive file=exchange.img,format=raw,media=disk
-netdev user,id=network0 -device sungem,netdev=network0 
https://drive.google.com/file/d/1LXmpxS ... sp=sharing

I am not sure what I am doing wrong. I tried about a dozen disk images, including the one I just converted from the qcow2 file. Nothing.


EDIT: I also tried loading JUST one of the new images, and got this:

Code: Select all

Last login: Sun Aug  2 00:02:22 on ttys000
/Users/ [USER]/Downloads/Qemu-4.1-OSX-23-08-2019/qemu.command ; exit;
(base)  [USER]-iMac:~ [USER]$ /Users/[USER]/Downloads/Qemu-4.1-OSX-23-08-2019/qemu.command ; exit;
qemu-system-ppc: Initialization of device ide-hd failed: Failed to lock byte 100
/Users/[USER]/Downloads/Qemu-4.1-OSX-23-08-2019/qemu.command: line 7: -netdev: command not found
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]
Obviously with [USER] replacing the original text. :P
User avatar
Cat_7
Expert User
Posts: 6172
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Probably missing something obvious. Mounting? sharing fi

Post by Cat_7 »

Code: Select all

#!/bin/bash
cd "$(dirname "$0")"

./qemu-system-ppc  -L pc-bios -boot c -M mac99,via=pmu -m 256 \
-drive file=disk.qcow2,format=qcow2,media=disk \
-drive file=exchange.img,format=raw,media=disk \
-netdev user,id=network0 -device sungem,netdev=network0
You can use the qemu.command as shown above. All other entries are not required as those reflect default settings anyway.

You forgot to end the new lines with a \ So the new entries were never read.
The \ lets Mac OS X read the qemu.command file as one line (it continues reading after the \). This is just a way to keep the file manageable so you don't have to keep changing text in a single line all the time. Only the last line does not need a \ to end it.

As said earlier, to be able to see the new disk image on your Mac OS desktop and to be able to open the image in OSX, you need to go the drive setup program in Mac OS and initialize the disk. It will then appear on your desktop. After shutting down Qemu you can open it in your OSX host.

If you continue using the qcow2 image as system disk, you might want to delete the img you created when converting the qcow2 file.

Best,
Cat_7
Jon God
Inquisitive Elf
Posts: 28
Joined: Fri Aug 05, 2011 6:18 am

Re: Probably missing something obvious. Mounting? sharing fi

Post by Jon God »

Code: Select all

Last login: Sun Aug  2 04:22:54 on ttys000
/Users/[USER]/Downloads/Qemu-4.1-OSX-23-08-2019/qemu.command ; exit;
(base) [USER]-iMac:~ [USER]$ /Users/[USER]/Downloads/Qemu-4.1-OSX-23-08-2019/qemu.command ; exit;
qemu-system-ppc: Initialization of device ide-hd failed: Failed to lock byte 100
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]
Is what terminal says when using that Qemu.command.
User avatar
Cat_7
Expert User
Posts: 6172
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Probably missing something obvious. Mounting? sharing fi

Post by Cat_7 »

Do you have an image mounted in your OSX host? Qemu cannot access such images.

Best,
Cat_7
Jon God
Inquisitive Elf
Posts: 28
Joined: Fri Aug 05, 2011 6:18 am

Re: Probably missing something obvious. Mounting? sharing fi

Post by Jon God »

That seems to have been the issue!

Thank you so much!!!
Post Reply