Re: How to launch a bhyve vm as normal user,without being root

From: Mario Marietto <marietto2008_at_gmail.com>
Date: Mon, 17 Jun 2024 14:12:51 UTC
Nice idea,but it does not work :

nano /home/marietto/.zshrc

# ~/.zshrc
# zsh autocompletion for sudo and doas
zstyle ":completion:*:(sudo|su|doas):*" command-path /usr/local/bin
/usr/local/sbin /usr/sbin /usr/bin /bin /sbin /bhyve

nano doas.conf

permit nopass marietto as root cmd bhyve-lin
permit nopass marietto as root cmd bhyve-win

nano 10-Debian-Now_wine-tkg-vm10

doas /usr/sbin/./bhyve-lin -S -c sockets=2,cores=2,threads=2 -m 8G -w -H -A
\
-s 0,hostbridge \
-s
1,ahci-hd,/mnt/zroot-133/bhyve/img/Linux/Debian-now-wine-tkg.img,bootindex=1
\
-s 11,hda,play=/dev/dsp,rec=/dev/dsp \
-s 13,virtio-net,tap10 \
-s 14,virtio-9p,sharename=/ \
-s 29,fbuf,tcp=0.0.0.0:5910,w=1600,h=950,wait \
-s 30,xhci,tablet \
-s 31,lpc \
-l bootrom,/usr/local/share/uefi-firmware/BHYVE_UEFI_CODE.fd \
vm0:10 < /dev/null & sleep 2 && vncviewer 0:10

=

doas: Operation not permitted

On Mon, Jun 17, 2024 at 2:24 PM Odhiambo Washington <odhiambo@gmail.com>
wrote:

>
>
> On Mon, Jun 17, 2024 at 2:19 PM Mario Marietto <marietto2008@gmail.com>
> wrote:
>
>> Hello.
>>
>> someone of you has been able to launch a bhyve vm as user using doas ?
>>
>> I'm trying but without success. First of all I created my doas.conf :
>>
>>
>> nano /usr/local/etc/doas.conf
>>
>> permit nopass :marietto cmd bhyve
>> permit nopass :marietto cmd vm-create
>>
>>
> permit nopass marietto as root cmd bhyve
>
> --
> Best regards,
> Odhiambo WASHINGTON,
> Nairobi,KE
> +254 7 3200 0004/+254 7 2274 3223
>  In an Internet failure case, the #1 suspect is a constant: DNS.
> "Oh, the cruft.", egrep -v '^$|^.*#' ¯\_(ツ)_/¯ :-)
> [How to ask smart questions:
> http://www.catb.org/~esr/faqs/smart-questions.html]
>


-- 
Mario.