Qemu: Want to mount a directory as HD

Programming, for all ages and all languages.
Post Reply
PeterX
Member
Member
Posts: 590
Joined: Fri Nov 22, 2019 5:46 am

Qemu: Want to mount a directory as HD

Post by PeterX »

I have a Qemu problem. I already searched the man page.

I have a HD image file (called ReactOS.img) and want a directory (called ros-hd) to be used as second HD.
I envoke:

Code: Select all

qemu-system-x86_64 -L . -m 1024 -hda ReactOS.img -hdb ros-hd
But it expects a file for "-hdb", not a directory.

Any help?

Greetings and thanks in advance
Peter
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Qemu: Want to mount a directory as HD

Post by iansjack »

Any reason why it has to be a directory and not another image file?
PeterX
Member
Member
Posts: 590
Joined: Fri Nov 22, 2019 5:46 am

Re: Qemu: Want to mount a directory as HD

Post by PeterX »

iansjack wrote:Any reason why it has to be a directory and not another image file?
I want to try to run Windows programs I download (which don't work with Wine). For example games.
I could create an image file every time I download a program but I would like to avoid that.

Greetings
Peter
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Qemu: Want to mount a directory as HD

Post by iansjack »

If you only need read access you can use a virtual FAT filesystem: https://en.wikibooks.org/wiki/QEMU/Devices/Storage
User avatar
zaval
Member
Member
Posts: 656
Joined: Fri Feb 17, 2017 4:01 pm
Location: Ukraine, Bachmut
Contact:

Re: Qemu: Want to mount a directory as HD

Post by zaval »

create a small .vhd file and use it as a second hard drive. but if you want to use ReactOS for running "some games", I think, you are gonna get a lot of adventures. :mrgreen:
ANT - NT-like OS for x64 and arm64.
efify - UEFI for a couple of boards (mips and arm). suspended due to lost of all the target park boards (russians destroyed our town).
nexos
Member
Member
Posts: 1081
Joined: Tue Feb 18, 2020 3:29 pm
Libera.chat IRC: nexos

Re: Qemu: Want to mount a directory as HD

Post by nexos »

zaval wrote:but if you want to use ReactOS for running "some games", I think, you are gonna get a lot of adventures.
Someone's got to test them. PeterX just wants to see what it'll be like.
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg
linuxyne
Member
Member
Posts: 211
Joined: Sat Jul 02, 2016 7:02 am

Re: Qemu: Want to mount a directory as HD

Post by linuxyne »

If it is the contents of the directory that's actually important, try 9pfs. But, guest (ReactOS here, I suppose) needs to support the particular devices that are involved.

[1]https://www.linux-kvm.org/page/9p_virtio
User avatar
bloodline
Member
Member
Posts: 264
Joined: Tue Sep 15, 2020 8:07 am
Location: London, UK

Re: Qemu: Want to mount a directory as HD

Post by bloodline »

iansjack wrote:If you only need read access you can use a virtual FAT filesystem: https://en.wikibooks.org/wiki/QEMU/Devices/Storage
I've been looking for something like this, many thanks for posting!!
CuriOS: A single address space GUI based operating system built upon a fairly pure Microkernel/Nanokernel. Download latest bootable x86 Disk Image: https://github.com/h5n1xp/CuriOS/blob/main/disk.img.zip
Discord:https://discord.gg/zn2vV2Su
Post Reply