{{tag>openbsd guides software}}
====== How to run Wine on OpenBSD ======
**Note: this is incomplete**
To run [[Wine]] on [[OpenBSD]] you need to emulate it within a VM. But it's not that bad since OpenBSD comes with a kernel level hypervisor called VMM that's quite good.
===== Setting up networking =====
*Add the following to ''/etc/sysctl.conf'': ''net.inet.ip.forwarding=1'' then run ''sysctl -f /etc/sysctl.conf'' to apply the changes
*Next, append the following to ''/etc/pf.conf'', (change [[dns]]-server)!
*
dns-server = "1.1.1.1"
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 $dns-server port domain
Reload pf with ''pfctl -f /etc/pf.conf''
===== VMD =====
Virtualization on your CPU must be enabled. VMD will not work otherwise. Linux is supported, Alpine Linux is known to work best, but I think you can use anything.
*''rcctl enable vmd''
*''rcctl start vmd''
*Now create a disk: ''vmctl create -s 50G disk.qcow2'' (Note: 50G is only the upper limit of the virtual disk's size, not its actual size)
*''vmctl start -m 2G -L -i 1 -c -r -d disk.qcow2 ''
*After installation finishes, ''vmctl stop ''
* (Optional) Add a line to ''/etc/hosts'' with your VM's ip:
* 100.64.1.3 alpine.local
===== Credits =====
[[https://www.openbsd-desktop.rocks/posts/linux-virtual-machine-vmm/]]
[[https://www.openbsd.org/faq/faq16.html]]