bhyve CBSD bhyve emulation problems with logging in

Hi,

I am newbie to both CBSD and bhyve. I have been using iocage-managed jails for 6+ years though.

To test I created a linux instance using cloud-Debian-x86-10.

This is roughly what I did:
- cbsd bconstruct-tui
- configured network address
- configured VNC-settings

I then start the new instance. I am also able to connect via VNC -- however I am not able to login on the login prompt that I am presented with when connecting with VNC. I have tried to re-create multiple times trying to adjust different options but without suceeding.

Any clue how I can continue to troubleshoot this?
 
Are you trying to login using a password? Each profile has its own cloud user (for a Debian profile this is 'debian' user). By default, cloud images used ~cbsd/.ssh/ `ed25519`-based key, e.g.:
Code:
ifconfig bridge100 create up description customer-1
ifconfig bridge100 inet 10.0.100.1/24
cbsd bcreate jname=vm1 flavor=small1 vm_os_type=linux vm_os_profile=cloud-Debian-x86-12 ci_ip4_addr=10.0.100.2 ci_gw4=10.0.100.1 interface=bridge100 runasap=1


after this operation, the login command should work by default:
Code:
cbsd blogin

if you want to use your own SSH key (or set a password for the root user or create your own users), you must use the appropriate args (these options are also available in the TUI-interface).
Check out `cbsd bcreate --help`, for example:
Code:
cbsd bcreate jname=vm2 vm_ram=4g vm_cpus=2 imgsize=10g vm_os_type=linux vm_os_profile=cloud-Debian-x86-12 ci_ip4_addr=10.0.100.3 ci_gw4=10.0.100.1 interface=bridge100 runasap=1 ci_user_pw_user='rootpw' ci_user_pw_root='userpw' ci_user_pubkey='/path/to/key.pub'

in this case, in addition to SSH key for 'debian' user, you can log in via VNC as 'root' with 'rootpw' password ( or 'debian' user with 'userpw' password)

In TUI:
1706544498161.png
 
Are you trying to login using a password? Each profile has its own cloud user (for a Debian profile this is 'debian' user). By default, cloud images used ~cbsd/.ssh/ `ed25519`-based key, e.g.:
Code:
ifconfig bridge100 create up description customer-1
ifconfig bridge100 inet 10.0.100.1/24
cbsd bcreate jname=vm1 flavor=small1 vm_os_type=linux vm_os_profile=cloud-Debian-x86-12 ci_ip4_addr=10.0.100.2 ci_gw4=10.0.100.1 interface=bridge100 runasap=1


after this operation, the login command should work by default:
Code:
cbsd blogin

if you want to use your own SSH key (or set a password for the root user or create your own users), you must use the appropriate args (these options are also available in the TUI-interface).
Check out `cbsd bcreate --help`, for example:
Code:
cbsd bcreate jname=vm2 vm_ram=4g vm_cpus=2 imgsize=10g vm_os_type=linux vm_os_profile=cloud-Debian-x86-12 ci_ip4_addr=10.0.100.3 ci_gw4=10.0.100.1 interface=bridge100 runasap=1 ci_user_pw_user='rootpw' ci_user_pw_root='userpw' ci_user_pubkey='/path/to/key.pub'

in this case, in addition to SSH key for 'debian' user, you can log in via VNC as 'root' with 'rootpw' password ( or 'debian' user with 'userpw' password)

In TUI:
View attachment 18072

Thanks for you reply!

After setting up the bridge100 I am able to login via [command]cbsd blogin[/command] using the ssh-keyfile. However I still cannot login via VNC with neiwther userpw or rootpw. Even though I used the exact command you provided when creating the vm.

Also, could you point me to some good resource explaining the networking when setting up the bridge100 as in your example? What are the basic steps to get internet access in the VM working? Adding the default route and enabling ip forwarding doesn't seem enough.
 
Also, could you point me to some good resource explaining the networking when setting up the bridge100 as in your example? What are the basic steps to get internet access in the VM working? Adding the default route and enabling ip forwarding doesn't seem enough.
if you are not using an external address for your virtual machine, you must configure a NAT using any of the three ( 'pf', 'ipfw' or 'ipfilter' ) engine available in FreeBSD. If you have not used a firewall yet, you can ask CBSD to configure simple NAT for you:
1)
Code:
cbsd natcfg
2) choose NAT engine
3) choose NAT IP address
4)
Code:
cbsd naton
 
if you are not using an external address for your virtual machine, you must configure a NAT using any of the three ( 'pf', 'ipfw' or 'ipfilter' ) engine available in FreeBSD. If you have not used a firewall yet, you can ask CBSD to configure simple NAT for you:
1)
Code:
cbsd natcfg
2) choose NAT engine
3) choose NAT IP address
4)
Code:
cbsd naton
Thanks for your reply!

First some info about my network setup:
  • em0 has trunk connection with 5 different VLANs
  • Server has two ways of reaching the internet:
    • Either through router on LAN
    • Directly via external IP on VLAN 2
  • VLAN 3 which has separate em0.3 interface configured is used for IoT devices
  • Unrelated: different FIBs are used to control which interface the application/daemon/jail use to connect to internet.

This was helpful -- but after some more thinking I was able to achieve my -- running HomeAssistant with access too my LAN VLAN -- by doing this:
  • creating a bridge: bridge0
  • adding em0.1 - VLAN interface for my LAN
  • Unrelated but also adding em1 (physical ethernet port used to connect network printer)
  • When creating bhyve instance via [command]cbsd bconstruct-tui[/command] I assigned the instance to the bridge interface: bridge0
  • Now bhyve HomeAssistance instance got IP via DHCP server running on the external router.
  • Success!

Now one more question: how do I assign more than one network interface to the bhyve instance? In this case I would like to give the HomeAssistance instance access to the VLAN3.
 
Now one more question: how do I assign more than one network interface to the bhyve instance? In this case I would like to give the HomeAssistance instance access to the VLAN3.
cbsd bconfig -> XXX -> bhyvenic -> Add (Add New Virtual Nic)
Choose nic_parent for the correct interface uplink

1708386914432.png

1708386943707.png

1708387064825.png
 
Back
Top