Re: QEMU, Windows 11, and Raspios

2024-10-21 Thread Jakob Bohm via

Hi list,

On 2024-10-19 14:09, G.W. Haywood wrote:

Hi there,

On Fri, 18 Oct 2024, Ignacio wrote:


I am currently using a laptop that is running Windows 11 and I have
downloaded QEMU. However, I cannot figure out how to use QEMU to emulate
Raspios. Raspios does not use a .iso, but instead a .img. I was 
wondering

if there is a way around this or if I am complicating this process.


There surely is a way.  The two data formats you mention are different
because they are used for different purposes.

[Snipped Long ranty description of everything but how to use the files 
with qemu ]

The rant got a lot of details wrong, so don't use it.

Here's the short version as I understand it:

For the .img file (if it is truly a bootable SD card image):

1. Create a Qemu copy-on-write (version 2) virtual SD card image which
uses the .img file as the base butkeeps all changes written by the
virtual RPi in the qcow2 file (this command specifies a 64G SD Card).

$ qemu-img create -f qcow2 \
 -o 
backing_file=rpiosNNN.img,backing_fmt=raw,lazy_refcounts=on,preallocation=metadata 
\

 raspiSD1.qcow2 64G

2. Pass the new sdcard raspiSD1.qcow2 as a disk to the
 qemu-system-aarch64 virtual machine emulator, also specify other
 relevant hardware such as the virtual RPi GPU, the virtual ethernet
 card, virtual keyboard/mouse etc.  Such qemu command lines can
 become quite long and thus you should put the arguments in a .BAT
 file for Windows (or .sh file for Linux etc.)

For .iso files with an OS for more normal hardware:

1. Create a blank thin provisioned virtual hard drive in qcow2 format
 (this command specifies a 0.5 TB HDD):

$ qemu-img crate -f qcow2 -o lazy_refcounts=on,preallocation=metadata \
  qemuPC1.qcow2 512G

2. Pass the new HDD qemuPC1.qcow2 as a disk to the qemu-system-x86_64
virtual machineemulator.  Pass the someosNNN.iso file as a read only
CD-ROM, also specify other hardware such as a virtual UEFI BIOS ROM,
a virtual GPU etc.  Such qemucommand lines can become quite long and
thus you should put the argumentsin a .BAT file for Windows (or .sh
file for Linux etc.).


Hint: On Windows 10 original (1507), Notepad was the obvious program
for editing .BAT files, later releases and Windows 11 may have Fouled
things Up Beyond All Repair (FUBAR).

P.S.: I am not sure if current qemu builds for Windows have a working
audio driver, a few years ago it didn't .

Enjoy

Jakob
--
Jakob Bohm, CIO, Partner, WiseMo A/S.  https://www.wisemo.com
Transformervej 29, 2860 Søborg, Denmark.  Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded




can not create the virtual machine

2024-10-21 Thread Alin Craciunescu
I receive this message:
Unable to complete install: 'internal error: process exited while
connecting to monitor: 2024-10-21T19:26:51.030843Z qemu-system-x86_64:
-blockdev
{"driver":"file","filename":"/home/xyz/Downloads/lubuntu-24.04.1-desktop-amd64
(1).iso","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}:
Could not open '/home/xyz/Downloads/lubuntu-24.04.1-desktop-amd64 (1).iso':
Permission denied'

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 72, in
cb_wrapper
callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/createvm.py", line 2008, in
_do_async_install
installer.start_install(guest, meter=meter)
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 695,
in start_install
domain = self._create_guest(
 ^^^
  File "/usr/share/virt-manager/virtinst/install/installer.py", line 637,
in _create_guest
domain = self.conn.createXML(initial_xml or final_xml, 0)
 
  File "/usr/lib/python3/dist-packages/libvirt.py", line 4529, in createXML
raise libvirtError('virDomainCreateXML() failed')
libvirt.libvirtError: internal error: process exited while connecting to
monitor: 2024-10-21T19:26:51.030843Z qemu-system-x86_64: -blockdev
{"driver":"file","filename":"/home/xyz/Downloads/lubuntu-24.04.1-desktop-amd64
(1).iso","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}:
Could not open '/home/xyz/Downloads/lubuntu-24.04.1-desktop-amd64 (1).iso':
Permission denied


Re: can not create the virtual machine

2024-10-21 Thread Pierrick Bouvier

On 10/21/24 12:36, Alin Craciunescu wrote:

I receive this message:
Unable to complete install: 'internal error: process exited while 
connecting to monitor: 2024-10-21T19:26:51.030843Z qemu-system-x86_64: 
-blockdev 
{"driver":"file","filename":"/home/xyz/Downloads/lubuntu-24.04.1-desktop-amd64 (1).iso","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}: Could not open '/home/xyz/Downloads/lubuntu-24.04.1-desktop-amd64 (1).iso': Permission denied'


Traceback (most recent call last):
   File "/usr/share/virt-manager/virtManager/asyncjob.py", line 72, in 
cb_wrapper

     callback(asyncjob, *args, **kwargs)
   File "/usr/share/virt-manager/virtManager/createvm.py", line 2008, in 
_do_async_install

     installer.start_install(guest, meter=meter)
   File "/usr/share/virt-manager/virtinst/install/installer.py", line 
695, in start_install

     domain = self._create_guest(
              ^^^
   File "/usr/share/virt-manager/virtinst/install/installer.py", line 
637, in _create_guest

     domain = self.conn.createXML(initial_xml or final_xml, 0)
              
   File "/usr/lib/python3/dist-packages/libvirt.py", line 4529, in createXML
     raise libvirtError('virDomainCreateXML() failed')
libvirt.libvirtError: internal error: process exited while connecting to 
monitor: 2024-10-21T19:26:51.030843Z qemu-system-x86_64: -blockdev 
{"driver":"file","filename":"/home/xyz/Downloads/lubuntu-24.04.1-desktop-amd64 (1).iso","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}: Could not open '/home/xyz/Downloads/lubuntu-24.04.1-desktop-amd64 (1).iso': Permission denied


Hi Alin,

it seems like the file /home/xyz/Downloads/lubuntu-24.04.1-desktop-amd64 
(1).iso has lower permissions than expected. Try chown $USER:$USER on 
this file and chmod 644, and launch qemu again.


Regards,
Pierrick