UserVM Handbook/Windows: Difference between revisions

no edit summary
No edit summary
No edit summary
 
== Setting up a Virtual Network ==
QEMU's user-mode networking used by default isn't very customizable and lacks the ability to block certain abuse vectors. For this reason we very strongly recommend setting up a Virtual Network using the [[CollabNet Guide]]. Depending on the full situation we may refuse to add VMs that use QEMU user-mode networking.
TODO: Windows version of CollabNet Guide host shit using OpenVPN wintun bullshit (pain)
 
It's also VERY important that mail ports are BLOCKED on your VM (the CollabNet guide config includes this). If you do not block them, your IP effectively becomes an open relay which will very likely get you suspended by your ISP or hosting provider. We will not add VMs with accessible mail ports
 
The following is the Windows version of the Host Preparation section of the CollabNet Guide.
 
=== IP Forwarding ===
 
First, we're going to enable IP forwarding on your host. This will allow traffic from the VMs to be routed to and from the router. The following command will write this to the registry.
 
{{code|lang=batch|<nowiki>
reg add HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters /v IPEnableRouter /d 1 /t REG_DWORD /f
</nowiki>}}
 
'''Reboot your system.'''
 
=== Bridge configuration ===
 
Next, we'll set up a network bridge with multiple TAP interfaces. You can think of a TAP interface as a virtual Ethernet port connected to your VM, and the network bridge as a virtual Ethernet switch connecting them all together.
 
First, install OpenVPN, which contains the TAP driver for Windows:
 
{{code|lang=batch|
choco install openvpn
refreshenv
}}
 
Now, create a TAP interface for the router and each of your VMs:
 
{{code|lang=batch|
cd "C:\Program Files\OpenVPN\bin"
tapctl create --name ktrouter
tapctl create --name ktvm1
(...)
}}
 
The last step is to bridge all of our TAP interfaces together. For some reason Microsoft decided you can't do this from the command line, so go ahead and open the Network Connections control panel:
 
{{code|lang=batch|
ncpa.cpl
}}
 
You should see a list of network adapters. Hold down the Ctrl key and click each of the TAP interfaces we created (<code>ktrouter</code>, <code>ktvm1</code>) to select them. Now, right click one of them and select <code>Bridge Connections</code> to create the bridge
 
Now, simply right click the new <code>Network Bridge</code> and rename it something friendly, like <code>collabnet</code>.
 
If you add new TAPs in the future, simply right click the <code>collabnet</code> bridge and go to properties, and tick the new TAP in the <code>Adapters</code> list.
 
You can now continue from the [[CollabNet_Guide#Setting_up_the_router|Router section of the CollabNet Guide]], with some obvious adjustments for windows.
 
== Configuration ==