bhyve # vm console hirsute Connected. OK,but now,what ?

ziomario

Well-Known Member

Reaction score: 29
Messages: 377

Hello.

I'm following this guide : https://github.com/churchers/vm-bhyve

because I want to boot and run ubuntu 21.04 hirsute with vm-bhyve. This is what I did right now.


Code:
[root@lozioma ~]# sysrc vm_enable="YES"
[root@lozioma ~]# sysrc vm_dir="/vms/os/linux"
[root@lozioma ~]# vm init
[root@lozioma ~]# cp /usr/local/share/examples/vm-bhyve/* /vms/os/linux/.templates/
[root@lozioma ~]# vm switch create public
[root@lozioma ~]# vm switch add public em0
[root@lozioma ~]# ifconfig

em0: flags=8963<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=481009b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,VLAN_HWFILTER,NOMAP>
        ether
        inet 192.168.1.6 netmask 0xffffff00 broadcast 192.168.1.255
        media: Ethernet autoselect (1000baseT <full-duplex>)
        status: active
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
        inet 127.0.0.1 netmask 0xff000000
        groups: lo
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>

vm-public: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether
        id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
        maxage 20 holdcnt 6 proto rstp maxaddr 2000 timeout 1200
        root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
        member: em0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 1 priority 128 path cost 20000
        groups: bridge vm-switch viid-4c918@
        nd6 options=9<PERFORMNUD,IFDISABLED>

[root@lozioma ~]# cd /vms
[root@lozioma /vms]# ls

iso     os

[root@lozioma /vms]# cd iso

[root@lozioma /vms/iso]# ls

linux   windows

[root@lozioma /vms/iso]# cd linux

[root@lozioma /vms/iso/linux]# ls

kubuntu-21.04-desktop-amd64.iso         ubuntu-budgie-21.04-desktop-amd64.iso
ubuntu-21.04-desktop-amd64.iso          ubuntustudio-21.04-dvd-amd64.iso

[root@lozioma /vms/iso/linux]# vm iso ubuntu-21.04-desktop-amd64.iso

/vms/os/linux/.iso/ubuntu-21.04-desktop-amd64.        2688 MB   28 MBps 01m36s

[root@lozioma /vms/iso/linux]# vm create hirsute

[root@lozioma /vms/iso/linux]# vm install hirsute ubuntu-21.04-desktop-amd64.iso

Starting hirsute
  * found guest in /vms/os/linux/hirsute
  * booting...

[root@lozioma /vms/iso/linux]# vm console hirsute
Connected

vm install -f hirsute ubuntu-21.04-desktop-amd64.iso
Starting hirsute
  * found guest in /vms/os/linux/hirsute
  ! guest appears to be running already

[root@lozioma /vms/iso/linux]# ps ax

2044  0- I      0:00.01 /bin/sh /usr/local/sbin/vm _run hirsute /vms/iso/linux/ubuntu-21.04-desktop-amd64.iso
2262  0- R     16:41.68 bhyveload -c /dev/nmdm-hirsute.1A -m 256M -e autoboot_delay=3 -d /vms/iso/linux/ubuntu-21.04-desktop-amd64.iso hirsute

ok but now,what should I do ? I don't see the installation of linux displayed somewhere.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 11,967
Messages: 38,420

Modern Linux installs often don't enable the serial console, which is what you're connecting to with vm console .... Try enabling graphics=yes and use a VNC client to connect to it.
 
OP
ziomario

ziomario

Well-Known Member

Reaction score: 29
Messages: 377

graphics=yes,into which configuration file I should put it ?
 
OP
ziomario

ziomario

Well-Known Member

Reaction score: 29
Messages: 377

vm configure hirsute
Code:
loader="bhyveload"
cpu=4
memory=8G
network0_type="virtio-net"
network0_switch="public"
disk0_type="virtio-blk"
disk0_name="disk0.img"
uuid="15c63b4c-e573-11eb-a8d9-e0d55ee21f22"
network0_mac="58:9c:fc:06:fe:8e"
graphics=yes
And I also did :
Code:
[root@lozioma /vms/os/linux/hirsute]# vm install hirsute ubuntu-21.04-desktop-amd64.iso
Starting hirsute
  * found guest in /vms/os/linux/hirsute
  * booting...

[root@lozioma /vms/os/linux/hirsute]# vm console hirsute
Connected
And here I tried to connect vncviewer to 0.0.0.0:5900,but vncviewer disappeared.

Code:
ps ax

2294  0  I      0:00.02 /bin/sh /usr/local/sbin/vm _run hirsute /vms/os/linux/.iso/ubuntu
2446  0  R      3:32.45 bhyveload -c /dev/nmdm-hirsute.1A -m 8G -e autoboot_delay=3 -d /v
2510  0  I+     0:00.01 /bin/sh /usr/local/sbin/vm console hirsute
2607  0  I+     0:00.00 cu -l /dev/nmdm-hirsute.1B
2608  0  I+     0:00.00 cu -l /dev/nmdm-hirsute.1B
 

Alain De Vos

Daemon

Reaction score: 608
Messages: 2,056

I once used the following trick for Void-linux.
Create the VM with Virtualbox, enable the serial console & ssh and migrate to Bhyve. But it was tedious.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 11,967
Messages: 38,420

Try adding this:
Code:
loader="uefi"
graphics="YES"
Then start the installer; vm install hirsute ubuntu-21.04-desktop-amd64.iso. Look at vm list to see the port the VNC is started on and connect your VNC client to it. Don't bother with vm console.
 
OP
ziomario

ziomario

Well-Known Member

Reaction score: 29
Messages: 377

nano /vms/os/linux/hirsute/hirsute.conf

loader="bhyveload"
cpu=4
memory=8G
network0_type="virtio-net"
network0_switch="public"
disk0_type="virtio-blk"
disk0_name="disk0.img"
uuid="15c63b4c-e573-11eb-a8d9-e0d55ee21f22"
network0_mac="58:9c:fc:06:fe:8e"
loader="uefi"
graphics="yes"

[root@lozioma /vms/os/linux/hirsute]# vm install hirsute ubuntu-21.04-desktop-amd64.iso

Starting hirsute
* found guest in /vms/os/linux/hirsute
* booting...

[root@lozioma /vms/os/linux/hirsute]# vm list

NAME = hirsute
DATASTORE = default
LOADER = bhyveload
CPU = 4
MEMORY = 8G
VNC -
AUTOSTART = no
STATE = Bootloader (2181)
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 11,967
Messages: 38,420

Remove the loader="bhyveload" at the top. For a Debian VM I also have grub_run_dir="/grub", not exactly sure if that's really needed.
 
OP
ziomario

ziomario

Well-Known Member

Reaction score: 29
Messages: 377

Attachments

  • SScreenshot_2021-07-16_17-16-47.png
    SScreenshot_2021-07-16_17-16-47.png
    253.1 KB · Views: 16
Top