Re: Permission Denied error when I try to open the image file stored on the ZFS disk accessed through sshfs from another machine...

2023-11-29 Thread Mario Marietto
> Another obvious but very insecure option is to instruct libvirt to
run the VM as the root user.

Is what I do,currently. Did you see my login prompt ?

*root*
@devuan-bunsen:/mnt/zroot2/zroot2/OS/Chromebook/FreeBSD-guestOS/freebsd-kvm#

It means that I do launch libvirtd & and virtlogd & as root. And this is
the reason why I use "-o
allow_root" on the sshfs command. But despite this,I can't access the image
file stored on the zfs disk.

On Wed, Nov 29, 2023 at 9:28 AM Peter Krempa  wrote:

> On Tue, Nov 28, 2023 at 21:32:39 -, marietto2...@gmail.com wrote:
> > Hello to everyone.
> >
> > I would like to boot the FreeBSD 13.2 image file using Libvirt +
> virt-manager. I have stored the image on the external hard
> drive,"formatted" with ZFS while I'm using Devuan 5 installed on my ARM (32
> bit) Chromebook,where I have access to the ZFS disk using sshfs using this
> command :
> >
> > sshfs -o Compression=no -o allow_root -o transform_symlinks -o
> password_stdin root@192.168.1.2:/mnt/zroot2/zroot2 /mnt/zroot2/zroot2 <<<
> 'pass'
> >
> > This is the error I get when I try to boot the image file using
> virt-manager :
> >
> > error : qemuProcessReportLogError:1990 : internal error: process exited
> while connecting to monitor: 2023-11-28T20:53:46.882586Z qemu-system-arm:
> -blockdev
> {"driver":"file","filename":"/mnt/zroot2/zroot2/OS/Chromebook/FreeBSD-guestOS/freebsd-kvm/FreeBSD-13.2-RELEASE-armv7.img","node-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap"}:
> Could not open
> '/mnt/zroot2/zroot2/OS/Chromebook/FreeBSD-guestOS/freebsd-kvm/FreeBSD-13.2-RELEASE-armv7.img':
> Permission denied
>
> Note that you didn't provide the VM xml or details on how the VM is
> configured so I'll speculate based on what most users would use.
>
> Important fact is that 'sshfs' by default doesn't allow other users to
> access the mounted directory. You partially bypassed that with "-o
> allow_root" but only for the root user.
>
> When a VM is run in the systme context (libvirt uri 'qemu:///system')
> then the VM process itself runs as the 'qemu' user and not root.
>
> So unless you've mounted the 'sshfs' as the qemu user, which would be
> hard to do it's most likely what's causing your problem.
>
> You can use -o allow_others, but beware that it indeed allows any
> user to access the sshfs mount.
>
> Some distros compile qemu with a direct ssh driver for disks, but that
> requires a very new libvirt and also you must setup SSH key
> authentication accessible from the user running your vm.
>
> Another obvious but very insecure option is to instruct libvirt to run
> the VM as the root user.
>
>

-- 
Mario.
___
Users mailing list -- users@lists.libvirt.org
To unsubscribe send an email to users-le...@lists.libvirt.org


Re: Permission Denied error when I try to open the image file stored on the ZFS disk accessed through sshfs from another machine...

2023-11-29 Thread Mario Marietto
Fixed,adding to : /usr/local/etc/libvirt/qemu.conf

the following parameters :

user = "root"
group = "root"

I'd forgotten this step. Very thanks bro'.

On Wed, Nov 29, 2023 at 10:15 AM Peter Krempa  wrote:

> On Wed, Nov 29, 2023 at 10:07:54 +0100, Mario Marietto wrote:
> > > Another obvious but very insecure option is to instruct libvirt to
> > run the VM as the root user.
> >
> > Is what I do,currently. Did you see my login prompt ?
> >
> > *root*
> >
> @devuan-bunsen:/mnt/zroot2/zroot2/OS/Chromebook/FreeBSD-guestOS/freebsd-kvm#
> >
> > It means that I do launch libvirtd & and virtlogd & as root. And this is
> > the reason why I use "-o
> > allow_root" on the sshfs command. But despite this,I can't access the
> image
> > file stored on the zfs disk.
>
> Any default installation of libvirt will run a VM started from a 'root'
> user as user 'qemu' for security reasons. You'd have to actively change
> that to run the qemu process as 'root' user.
>
> You didn't post any VM xml or libvirt config, so I've assumed the
> default. Did you explicitly set the user for the VM to run as in the VM
> xml? Or did you modify /etc/libvirt/qemu.conf?
>
>

-- 
Mario.
___
Users mailing list -- users@lists.libvirt.org
To unsubscribe send an email to users-le...@lists.libvirt.org


Re: Internal Error: libxenlight failed to create new domain "FreeBSD-13.2"

2023-11-29 Thread Mario Marietto
ok. I tried to fix the broken installation and now the error is changed :

Traceback (most recent call last):
  File "/usr/lib/xen-4.17/bin/pygrub", line 884, in 
raise RuntimeError("Unable to find partition containing kernel")
RuntimeError: Unable to find partition containing kernel

On Wed, Nov 29, 2023 at 2:53 PM Michal Prívozník 
wrote:

> On 11/29/23 14:04, marietto2...@gmail.com wrote:
> > The reason for that error maybe written inside this log messages :
> >
> > libxl: libxl_event.c:855:libxl__ev_xswatch_deregister: remove watch for
> path @releaseDomain: Descrittore di file errato
> >
> > libxl: libxl_event.c:855:libxl__ev_xswatch_deregister: remove watch for
> path @releaseDomain: Bad file descriptor
> >
> > libxl: libxl_event.c:855:libxl__ev_xswatch_deregister: remove watch for
> path @releaseDomain: Bad file descriptor
> >
> > libxl: libxl_arm.c:1538:libxl__arch_domain_create_info_setdefault:
> Converting PV guest to PVH.
> >
> > libxl: libxl_arm.c:1539:libxl__arch_domain_create_info_setdefault: Arm
> guest are now PVH.
> >
> > libxl: libxl_arm.c:1540:libxl__arch_domain_create_info_setdefault:
> Please fix your configuration file/toolstack.
> >
> > libxl: libxl_bootloader.c:648:bootloader_finished: Domain 1:bootloader
> failed - consult logfile /var/log
> > /xen/bootloader.1.log
> >
>
> This tells you to look into the log file. Did you? What is there?
>
> 
> >
> > Traceback (most recent call last):
> >  File "/usr/lib/xen-4.17/bin/pygrub", line 27, in 
> >import xenfsimage
> > ImportError: libxenfsimage.so.4.17: cannot open shared object file: No
> such file or directory
>
> Is this the contents of that file? If so, then your xen installation is
> broken because it did not install the .so.
>
> Michal
>
>

-- 
Mario.
___
Users mailing list -- users@lists.libvirt.org
To unsubscribe send an email to users-le...@lists.libvirt.org


Re: Internal Error: libxenlight failed to create new domain "FreeBSD-13.2"

2023-11-29 Thread Mario Marietto
I think I found the solution here :

https://blog.roberthallam.org/2020/05/solving-unable-to-find-partition-containing-kernel/

I've created a file called menu.lst inside the boot directory of the image
file called "debian.img",adding the following content inside :

default 0
timeout 10
title Debian
root (hd0,1)
kernel /boot/vmlinux-6.1.59-stb-xen-cbe+ root=/dev/xvda
initrd /boot/initrd.img-6.1.59-stb-xen-cbe+

and I tried again to boot the image using virt-manager. It gave this error
again :

root@devuan-bunsen:/mnt/zroot2/zroot2/OS/Chromebook/FreeBSD-guestOS/linux-xen/debian2/boot#
2023-11-29 15:21:09.266+: 2467: error : libxlDomainStartPerform:1256 :
internal error: libxenlight failed to create new domain 'debian12'

but giving a look inside the log file and I found this interesting
situation ;

Using  to parse /boot/grub/menu.lst
(B )0 [1;24r [m [?7h [?1h = [H [J [?1h = [1BpyGRUB  version 0.6
[1B [0m
lk
[1B [0m x [0;7m Debian 12
  [m [0m x
[1B [0m x [72C [0m x
[1B [0m x [72C [0m x
[1B [0m x [72C [0m x
[1B [0m x [72C [0m x
[1B [0m x [72C [0m x
[1B [0m x [72C [0m x
[1B [0m x [72C [0m x
[1B [0m
mj
[1B [70D [0m Use the ↑ and ↓ keys to select which entry is highlighted. [1B
[58DPress enter to boot the selected OS, 'e' to edit the [1B [52Dcommands
before booting, 'a' to modify the kernel arguments [1B [59Dbefore booting,
or 'c' for a command line. [12A [26C [17B [68DWill boot selected entry in
10 seconds [?1h =
[J [17A [73C [17B [68DWill boot selected entry in  9 seconds [?1h =
[J [17A [73C [17B [68DWill boot selected entry in  8 seconds [?1h =
[J [17A [73C [17B [68DWill boot selected entry in  7 seconds [?1h =
[J [17A [73C [17B [68DWill boot selected entry in  6 seconds [?1h =
[J [17A [73C [17B [68DWill boot selected entry in  5 seconds [?1h =
[J [17A [73C [17B [68DWill boot selected entry in  4 seconds [?1h =
[J [17A [73C [17B [68DWill boot selected entry in  3 seconds [?1h =
[J [17A [73C [17B [68DWill boot selected entry in  2 seconds [?1h =
[J [17A [73C [17B [68DWill boot selected entry in  1 seconds [?1l > [24;1H
[?1l >

so,it seems that it tried to boot,but for an unknown reason,it gave the
error anyway.

On Wed, Nov 29, 2023 at 3:27 PM Mario Marietto 
wrote:

> ok. I tried to fix the broken installation and now the error is changed :
>
> Traceback (most recent call last):
>   File "/usr/lib/xen-4.17/bin/pygrub", line 884, in 
> raise RuntimeError("Unable to find partition containing kernel")
> RuntimeError: Unable to find partition containing kernel
>
> On Wed, Nov 29, 2023 at 2:53 PM Michal Prívozník 
> wrote:
>
>> On 11/29/23 14:04, marietto2...@gmail.com wrote:
>> > The reason for that error maybe written inside this log messages :
>> >
>> > libxl: libxl_event.c:855:libxl__ev_xswatch_deregister: remove watch for
>> path @releaseDomain: Descrittore di file errato
>> >
>> > libxl: libxl_event.c:855:libxl__ev_xswatch_deregister: remove watch for
>> path @releaseDomain: Bad file descriptor
>> >
>> > libxl: libxl_event.c:855:libxl__ev_xswatch_deregister: remove watch for
>> path @releaseDomain: Bad file descriptor
>> >
>> > libxl: libxl_arm.c:1538:libxl__arch_domain_create_info_setdefault:
>> Converting PV guest to PVH.
>> >
>> > libxl: libxl_arm.c:1539:libxl__arch_domain_create_info_setdefault: Arm
>> guest are now PVH.
>> >
>> > libxl: libxl_arm.c:1540:libxl__arch_domain_create_info_setdefault:
>> Please fix your configuration file/toolstack.
>> >
>> > libxl: libxl_bootloader.c:648:bootloader_finished: Domain 1:bootloader
>> failed - consult logfile /var/log
>> > /xen/bootloader.1.log
>> >
>>
>> This tells you to look into the log file. Did you? What is there?
>>
>> 
>> >
>> > Traceback (most recent call last):
>> >  File "/usr/lib/xen-4.17/bin/pygrub", line 27, in 
>> >import xenfsimage
>> > ImportError: libxenfsimage.so.4.17: cannot open shared object file: No
>> such file or directory
>>
>> Is this the contents of that file? If so, then your xen installation is
>> broken because it did not install the .so.
>>
>> Michal
>>
>>
>
> --
> Mario.
>


-- 
Mario.
___
Users mailing list -- users@lists.libvirt.org
To unsubscribe send an email to users-le...@lists.libvirt.org


How to enable KVM nesting virtualization on the Jetson nano.

2024-09-21 Thread Mario Marietto
Hello to everyone.

while I was looking for a way to enable the nesting virtualization on my
Jetson nano,after having enabled KVM applying these patches :

https://github.com/OE4T/linux-tegra-4.9/blob/oe4t-patches-l4t-r37.4/


When I have googled for acquiring more informations,I found these
interesting threads :

https://patches.linaro.org/project/qemu-devel/patch/b7c2626e6c720ccc43e57197dff3dac72d613640.1616052890.git.haibo...@linaro.org/

https://superuser.com/questions/1838383/arm-cpu-nested-virtualization-how-can-i-make-vcpu-start-from-el2

On the first site,he says :


> can be enabled by "-M virt,accel=kvm,virtualization=on" when starting a VM

Good,I could try,but I'm not using qemu directly (I've installed qemu
vers. 9) ,but
virt-manager version 4.0. Maybe I should upgrade it ?

In virt-manager I don't see how I can specify those parameters.
Anyway I'm not sure that it will work,because on the second thread he said to :

-append "kvm-arm.mode=nested" \


Where is the truth ?

Very thanks.


-- 
Mario.


How to use UEFI_VARS.fd using virt-manager on Ubuntu 24.04...

2024-10-01 Thread Mario Marietto
Hello.

On FreeBSD I've installed Windows 11 on the first partition of a 200 GB
disk and Android X86 on the second partition of a 200 GB image file called
"Android.img". This is how I boot Android :

/usr/sbin/./bhyve-win -S -c sockets=4,cores=2,threads=1 -m 8G -w -H -A \
-s 0,hostbridge \
-s 1,ahci-hd,/mnt/zroot-133/bhyve/img/Android/Android.img,bootindex=1 \
-s 13,virtio-net,tap13 \
-s 29,fbuf,tcp=0.0.0.0:5913,w=1600,h=950,wait \
-s 30,xhci,tablet \
-s 31,lpc \
-l
bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd,/usr/local/share/uefi-firmware/BHYVE_UEFI_VARS.fd
\

as you can see to boot Android correctly,I SHOULD use
"/usr/local/share/uefi-firmware/BHYVE_UEFI_VARS.fd"

Now I'm using Ubuntu 24.04 and I want to boot Android from the same img
file. But,what I don't know is how to add the parameter
"/usr/local/share/uefi-firmware/BHYVE_UEFI_VARS.fd" to virt-manager.

Without it Android will not boot,but only Windows is able to boot ONLY from
the first partition
-- 
Mario.