hvsock related systemd and nm config files#202
Conversation
cfergeau
left a comment
There was a problem hiding this comment.
Thanks for these files, these were the missing bits after the addition of --preexisting!
contrib/systemd/user_network.service
Outdated
| @@ -0,0 +1,10 @@ | |||
| [Unit] | |||
| Description=vsock_network | |||
There was a problem hiding this comment.
This could use a more descriptive name, such as gvisor-tap-vsock traffic forwarder, or Network Traffic Forwarder over virtio-vsock
contrib/systemd/user_network.service
Outdated
| @@ -0,0 +1,10 @@ | |||
| [Unit] | |||
| Description=vsock_network | |||
| After=NetworkManager.service | |||
There was a problem hiding this comment.
I'd add After=sys-devices-virtual-net-vsock0.device, and possibly BindsTo=sys-devices-virtual-net-vsock0.device, but I think with the latter Praveen had issues with systemctl restart user_network.service
There was a problem hiding this comment.
well, i know this works as is ... do you want to change it when you do a switch over?
There was a problem hiding this comment.
I'll experiment a bit with this and the removal of ExecStartPost=/usr/bin/nmcli c up vsock0 and let you know!
|
Fwiw, the golangci-lint failures are fixed in git main |
|
updated |
cfergeau
left a comment
There was a problem hiding this comment.
2 small things to fix, apart from this looks good to me!
| After=NetworkManager.service | ||
|
|
||
| [Service] | ||
| [Service] |
contrib/systemd/user-network.service
Outdated
| Environment=GV_TAP_DEVICE="vsock0" | ||
| Environment=GV_VSOCK_PORT="1234" | ||
| EnvironmentFile=-/etc/sysconfig/gv-user-network | ||
| ExecStart=/usr/libexec/podman/vm -preexisting -iface $GV_TAP_DEVICE -url vsock://2:$GV_VSOCK_PORT/connect |
There was a problem hiding this comment.
For some reason, systemd wants {} around the env var names, otherwise it won't expand GV_VSOCK_PORT: ExecStart=/usr/libexec/podman/vm -preexisting -iface ${GV_TAP_DEVICE} -url vsock://2:${GV_VSOCK_PORT}/connect
the network manager file configures a vsock0 network interface with the specific mac-address that gvproxy needs. this must be run before the vm command is run. the systemd file is for running the vm command after network manager creates the network interface. the url must be modified with the vm ID when using hvsock and Microsoft HyperV virtualization. Once the vm command has been run, we issue a postexec to ask NM to bring the "link" up. this may not be entirely necessary but wfm. Signed-off-by: Brent Baude <bbaude@redhat.com>
cfergeau
left a comment
There was a problem hiding this comment.
I fixed the 2 issues I last mentioned, and changed the default port from 1234 to 1024 since this is what vm uses by default.
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: baude, cfergeau The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
the network manager file configures a vsock0 network interface with the specific mac-address that gvproxy needs. this must be run before the vm command is run.
the systemd file is for running the vm command after network manager creates the network interface. the url must be modified with the vm ID when using hvsock and Microsoft HyperV virtualization. Once the vm command has been run, we issue a postexec to ask NM to bring the "link" up. this may not be entirely necessary but wfm.