? Editing: Post:21.body Save Delete Cancel
Content changed Sign & Publish new content


My nerdy blog.

Follow in NewsfeedFollowing

Latest comments:

Add new post


21 hours ago · 2 min read ·
Read more

Not found

Install and run an OpenBSD VM (in vmd)

on Jun 22, 2017 · 1 min read

I will describe here how to install an OpenBSD virtual machine under OpenBSD with VMM. Then in a future post we'll cover how to install ZeroNet (VPN+Tor+dnscrypt_proxy+pf) on this VM.

Let's get the install kernel and the install image for OpenBSD 6.1 amd64:

# ftp http://mirror.bytemark.co.uk/OpenBSD/6.1/amd64/bsd.rd
# ftp http://mirror.bytemark.co.uk/OpenBSD/6.1/amd64/install61.fs

Before I forgot let's enable vmd and stard it:

# rcctl enable vmd && rcctl start vmd

I am creating a 64GB image file for the VM then I start the install image booting on the install kernel and setting up 2GB of ram for it. The -c option will get you straight connected to the console.

# vmctl create zero.drive -s 64G
# vmctl start "zerovm" -c -b bsd.rd -m 2G -i 1 -d zero.drive -d install61.fs

Do a standard install - nothing special, all default options make sense.When you get to the installation of sets, choose "disk > not mounted > sd1 > a".
Once it's done and your back at the shell prompt. Exit the VM console using the key sequence ~^D (tilde ctrl-D).
Stop the VM and check the status of the VM

# vmctl stop zerovm 
# vmctl status

Let's configure the VM to start at boot with the correct parameter and a virtual ethernet switch on the LAN (feel free to use another IP subnet than your real LAN so it will be even easier to filter with pf on the host).
Create the virtual interface:

# echo "inet 192.168.X.1 NONE" > /etc/hostname.vether0

Make sure you allow traffic on this interface in your host /etc/pf.conf

vmd_if = "vether0"
pass out quick on $vmd_if inet
pass in quick on $vmd_if inet

Create your /etc/vm.conf :

files=  /usr/where/ever/you/have/yourvm/store/
vm zerovm {
   memory 2g
   disk $files zero.drive
   interface tap { lladdr 00:01:02:03:04:05 switch localnet }
switch localnet {
   add vether0

That should be it...
create the interface (the hostname.vether0 is to have it at boot time) then refresh your pf to take your change into account and restart vmd:

# ifconfig vether0 create
# ifconfig vether0 inet 192.168.X.1
# pfctl -f /etc/pf.conf
# rcctl restart vmd

If everything went smooth the VM should start check and connect to it:

# vmctl status
# vmctl console zerovm

That's it... next time we'll see how to install zeronet on this pretty new VM running on OpenBSD of course! (I assume you've configured the VM network properly within the same subnet that the vether0 etc.. etc...)

#howto #openbsd #vmm

0 Comment:

user_name1 day ago
This page is a snapshot of ZeroNet. Start your own ZeroNet for complete experience. Learn More