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

2024-06-17 Thread Odhiambo Washington
##/usr/local/etc/doas.conf# permit :wheel permit nopass keepenv :wheel permit alice as root permit keepenv bob as root permit cindy as root cmd pkg args update permit cindy as root cmd pkg args upgrade permit nolog david as root cmd id permit www as root cmd pfctl permit

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

2024-06-17 Thread Mario Marietto
I want to keep the bhyve scripts in /bhyve and I've added the path /bhyve to /home/marietto/.zshrc and on /root/.zshrc like this : # sudo nano /home/marietto/.zshrc export PATH=/bhyve:$PATH # zsh autocompletion for sudo and doas zstyle ":completion:*:(sudo|su|doas):*" command-path /usr/local/bin

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

2024-06-17 Thread Dave Cottlehuber
On Mon, 17 Jun 2024, at 17:39, Mario Marietto wrote: > [marietto@marietto /bhyve]==> sudo cp 12-Win-11-vm12 /usr/sbin this filepath is /usr/sbin/12-Win-11-vm12 > permit nopass :wheel as root cmd /usr/sbin/bhyve-win this file path is /usr/sbin/bhyve-win these things need to be identical, like in

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

2024-06-17 Thread Mark Peek
I was just responding... Works for me using the full path to the command. You should try as well with the full path to the command. $ ls -l /bhyve/12-Win-11-vm12 -rwxr-xr-x 1 root wheel 22 Jun 17 13:25 /bhyve/12-Win-11-vm12 $ cat !$ cat /bhyve/12-Win-11-vm12 #!/bin/sh echo $USER $ ls -l /bhyve/

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

2024-06-17 Thread Mario Marietto
I had an illumination and I found how it works : [marietto@marietto /bhyve]==> doas /bhyve/12-Win-11-vm12 But why ? On Mon, Jun 17, 2024 at 10:15 PM Mario Marietto wrote: > nano /usr/local/etc/doas.conf : > > permit nopass :wheel as root cmd bhyve-win > permit nopass :wheel as root cmd bhyve-

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

2024-06-17 Thread Mario Marietto
nano /usr/local/etc/doas.conf : permit nopass :wheel as root cmd bhyve-win permit nopass :wheel as root cmd bhyve-lin permit nopass :wheel as root cmd /bhyve/12-Win-11-vm12 [marietto@marietto /bhyve]==> doas 12-Win-11-vm12 doas: Operation not permitted On Mon, Jun 17, 2024 at 9:50 PM Mark Peek

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

2024-06-17 Thread Mark Peek
Likely because you don't have this in the doas.conf file: permit nopass :wheel as root cmd /bhyve/12-Win-11-vm12 On Mon, Jun 17, 2024 at 11:35 AM Mario Marietto wrote: > If I keep the bhyve scripts in /usr/sbin,it works. But I want to keep the > bhyve scripts in /bhyve and I don't want to keep

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

2024-06-17 Thread Mario Marietto
If I keep the bhyve scripts in /usr/sbin,it works. But I want to keep the bhyve scripts in /bhyve and I don't want to keep them in /usr/sbin. For this reason I've added the path /bhyve to /home/marietto/.zshrc like this : # ~/.zshrc # zsh autocompletion for sudo and doas zstyle ":completion:*:(su

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

2024-06-17 Thread Mark Peek
Likely need to add this as it is what you are passing to doas as the command to execute: permit nopass :wheel as root cmd /usr/sbin/12-Win-11-vm12 Mark On Mon, Jun 17, 2024 at 10:40 AM Mario Marietto wrote: > > [marietto@marietto /bhyve]==> sudo cp 12-Win-11-vm12 /usr/sbin > > [marietto@mariett

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

2024-06-17 Thread Mario Marietto
[marietto@marietto /bhyve]==> sudo cp 12-Win-11-vm12 /usr/sbin [marietto@marietto /bhyve]==> nano /usr/sbin/12-Win-11-vm12 #!/bin/sh bhyve-win -S -c sockets=4,cores=2,threads=1 -m 8G -w -H \ -S -c sockets=4,cores=2,threads=1 -m 8G -w -H \ -s 0,hostbridge \ -s 1,ahci-hd,/mnt/da4p2/bhyve/img/Windo

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

2024-06-17 Thread Dave Cottlehuber
On Mon, 17 Jun 2024, at 14:12, Mario Marietto wrote: > Nice idea,but it does not work : > > nano /home/marietto/.zshrc > > # ~/.zshrc Hi Mario, I think your zsh stuff is getting in the way here. Your zshrc function is not visible to the root user, as doas cleans up all the env and so your function

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

2024-06-17 Thread Mario Marietto
Can you paste here the contents of doas.conf and debian.sh ? thanks. On Mon, Jun 17, 2024 at 5:35 PM Odhiambo Washington wrote: > > > On Mon, Jun 17, 2024 at 5:13 PM Mario Marietto > wrote: > >> Nice idea,but it does not work : >> > > It worked for me! > > I created a bash script file named deb

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

2024-06-17 Thread Odhiambo Washington
On Mon, Jun 17, 2024 at 5:13 PM Mario Marietto wrote: > Nice idea,but it does not work : > It worked for me! I created a bash script file named debian.sh which contained all the bhyve args to create the VM, then I just did: doas debian.sh And I actually successfully installed the VM and it's

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

2024-06-17 Thread Mario Marietto
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 perm

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

2024-06-17 Thread Odhiambo Washington
On Mon, Jun 17, 2024 at 2:19 PM Mario Marietto 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 no

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

2024-06-17 Thread Mario Marietto
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 and then I tried to lauch the vm below :