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

From: Dave Cottlehuber <dch_at_skunkwerks.at>
Date: Mon, 17 Jun 2024 16:54:03 UTC
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 is unknown.

So start off with something without bhyve, make sure you are in
wheel group, and add a shell script called
/usr/local/bin/hallo:

```
#!/bin/sh
echo hallo $USER
```

chmod 0755 /usr/local/bin/hallo

```
# /usr/local/etc/doas.conf (per doas.conf manpage)
permit nopass :wheel as root cmd /usr/local/bin/hallo
```

$ doas /usr/local/bin/hallo
hallo root

then replace your bhyve commands in the hallo script.

Off the top of my head there's no reason for bhyve to need
anything different to hallo script.
A+
Dave