Headless bhyve

Andrew Schmidt

New Member

Reaction score: 2
Messages: 7

I can't get a guest to start without a display.
If there's a way to do it, I can't get it to work.
I'm using 10.3. Any advice?
 

tetragir

Member

Reaction score: 16
Messages: 82

Hi,
could you please share more information on what exactly the problem is and what is it you want to achieve?
What is the guest OS, you want to boot?
 
OP
OP
A

Andrew Schmidt

New Member

Reaction score: 2
Messages: 7

Sorry I wasn't CLEAR enough.

I want to start bhyve headless (without a display attached)
How do I do this, or where do I find out how to do this.

Do you understand my question?

@soredice-
That's not what I'm looking for. I thank you, though.
 

usdmatt

Daemon

Reaction score: 521
Messages: 1,399

The most common way of running bhyve guests "headless" is to use null modem devices.
You attach the serial console of the bhyve guest to a null modem 'A' port using the -l option:
Code:
bhyve ... -l com1,/dev/nmdm0A ...
Then you can access the console if needed by connecting to the 'B' port:
Code:
cu -l /dev/nmdm0B
If you have more than one vm you can use nmdm1A, 2A, etc.

This is covered in the handbook pages linked by SirDice above.

It's also possible to run bhyveload in this way using the -c /dev/nmdmA option, although you probably don't need to do that when running bhyveload/bhyve by hand.

The bhyve process will still 'hang' until the guest exits though, so you'd need to run bhyve ...options... guest & to have it actually run in the background and return you to your terminal.

I'd highly recommend just using one of the bhyve tools already available though.
 

SirDice

Administrator
Staff member
Administrator
Moderator

Reaction score: 7,755
Messages: 30,864

Actually, you can only run VMs "headless". There's no VGA adapter virtualization yet. So in essence they're always headless :D

Defenitely read the handbook and play with the examples. Then try the tools I mentioned earlier. They make it so much easier to create, move, delete, stop/start and get a console.
 

kakawkaization

New Member


Messages: 5

Hello all. I have same problem with run bhyve headless.

I do like you describe.

This is my settings for bhyve guest.

Code:
bhyveload -c /dev/nmdm1A -m 1024 -d /vm/f1/f1.img f1

bhyve -c 1 -m 1024M -H -P -A \
-l com1,/dev/nmdm1A \
-s 0:0,hostbridge \
-s 1:0,lpc \
-s 2:0,virtio-net,tap2 \
-s 4,virtio-blk,/vm/f1/f1.img f1
I create startup script and locate it to /usr/local/etc/rc.d/.

Script is starting on booting bhyve server, but it's not headless.

Instructions like:
Code:
bhyveload -c /dev/nmdm1A...
-l com1,/dev/nmdm1A...
Is not working.

Please tell me what to do?
 

usdmatt

Daemon

Reaction score: 521
Messages: 1,399

It depends exactly what you mean by headless, which seems to have gathered numerous meanings...
If you run bhyve using a nmdm device, the guest console will output to that. You then open the "B" nmdm device using cu to connect to it. However the bhyve command will still "hang" until the guest shuts down, because the bhyve command obviously keeps running while the guest is running.

Unless you really want to get your hands dirty I'd recommend just using something like my sysutils/vm-bhyve manager ;)
 
Top