Merge branch 'staged'
[dports.git] / sysutils / bhyve-rc / pkg-message
1 [
2 { type: install
3   message: <<EOM
4 Configuration is done completely though rc.conf.
5 The rc script won't touch any devices for you (neither disk, nor tap)
6 so you need to make sure all of those have been initialized properly.
7
8 General setup:
9 kldload vmm
10 net.link.tap.up_on_open=1
11
12 Make it persistent:
13 echo "net.link.tap.up_on_open=1" >> /etc/sysctl.conf
14 cat >> /boot/loader.conf << EOF
15 vmm_load="YES"
16 EOF
17
18 Minimal example:
19 cat >> /etc/rc.conf << EOF
20 cloned_interfaces="tap0 bridge0"
21 bhyve_enable="YES"
22 bhyve_diskdev="/dev/zvol/tank/bhyve/virt"
23 EOF
24
25 ifconfig tap0 create
26 ifconfig bridge0 create
27
28 service bhyve start
29 tmux list-sessions
30 tmux attach -t bhyve
31 service bhyve status
32 service bhyve stop
33
34 Multi profile configuration example:
35 cat >> /etc/rc.conf << EOF
36 cloned_interfaces="tap0 tap1 bridge0"
37 bhyve_enable="YES"
38 bhyve_profiles="virt1 virt2"
39 bhyve_virt1_diskdev="/dev/zvol/tank/bhyve/virt1"
40
41 bhyve_virt2_tapdev="tap1"
42 bhyve_virt2_diskdev="/dev/zvol/tank/bhyve/virt2"
43 bhyve_virt2_memsize="8192"
44 bhyve_virt2_ncpu="4"
45 EOF
46
47 ifconfig tap0 create
48 ifconfig tap1 create
49 ifconfig bridge0 create
50
51 service bhyve start # start all
52 service bhyve start virt2 # start individual
53 tmux attach -t bhyve_virt1
54 tmux attach -t bhyve_virt1
55 service bhyve stop virt2 # stop individual
56 service bhyve stop # stop all
57
58 (by default ctrl-b d detaches from tmux).
59 EOM
60 }
61 ]