_ _
___ | |__ __ _ _______ | |_
/ _ \| '_ \ / _` |_ / _ \| __|
| (_) | | | | (_| |/ / (_) | |_
\___/|_| |_|\__,_/___\___/ \__|
vm —
configuration, usage and
tips
vmctl create -s 50G disk.qcow2
vmctl start -m 1G -i 1 -b /bsd -d disk.qcow2 myvm
vmctl show #will show mywm
vmctl console myvm
vmctl stop myvm
OpenBSD, centos, archlinux, opensuse.
Some linux distributions may not have the serial console enabled
by default, the following is an example for Slackware lilo.
- On the boot loader press tab.
- type:
huge.s serial 0 115200,
console=ttyS0,115200
- to disconnect from the console but keep the vm running: [ENTER] ~^d
| NOTE: This has been tested on slackware, centos, archlinux,
opensuse. |
(back to top)
- allow forwarding.
sysctl
net.inet.ip.forwarding=1
- vm.conf:
vm vm_name {
...
local interface
}
- pf.conf : this provides the vm with a dns.
match out on egress from 100.64.0.0/10 to any nat-to (egress)
pass in proto { udp tcp } from 100.64.0.0/10 to any port domain rdr-to 192.168.1.1 port domain
- reload pf.conf: after this the vm will have internet access.
pfctl -f
/etc/pf.conf
(back to top)
The vm can be accessed through ssh from the host using the local
interface:
ssh 100.64.1.3
For external access, follow these steps:
- allow external access (pc other than the host) using pf.
pass in on egress proto tcp from
any to any port [EXTERNAL_PORT] rdr-to [VM_IP] port [VM_PORT]
- reload pf.conf: after this the vm will be accessible by other machines in
the network.
pfctl -f
/etc/pf.conf
| example |
: ssh |
| host ip |
: 192.168.1.10 |
| guest |
: 100.64.1.3 |
| - pf.conf (on the host):
pass in on egress proto tcp from
any to any port 10122 rdr-to 100.64.1.3 port 22
|
| - Reload pf.conf:
pfctl -f
/etc/pf.conf
|
| - ssh command:
ssh -p 10122
192.168.1.10
|
(back to top)
| - test and document real host in the network. |
| - slackware: unable to load virtio, it doesn't detect vda. This was an
issue at some point, needs to be re-tested. |
| - Verify parameters for other linux distributions. |
| - Add permanent kernel parameters. |
| - create vm to follow OpenBSD current upon 7.8 release. |
| - Translate to Spanish. |