mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-11-01 10:27:55 +00:00
Add vmnet support to linuxkit run hyperkit
Allows routed networking, so long as you runhyperkit as root. This has quite a few downsides, including the requirement to run as root in order to set up the networking, but some people really want VMs that are routable from the host. Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
8
vendor/github.com/moby/hyperkit/go/hyperkit.go
generated
vendored
8
vendor/github.com/moby/hyperkit/go/hyperkit.go
generated
vendored
@@ -98,6 +98,9 @@ type HyperKit struct {
|
||||
// VSock guest CID
|
||||
VSockGuestCID int `json:"vsock_guest_cid"`
|
||||
|
||||
// VMNet whether to create vmnet network
|
||||
VMNet bool `json:"vmnet"`
|
||||
|
||||
// 9P sockets
|
||||
Sockets9P []Socket9P `json:"9p_sockets"`
|
||||
|
||||
@@ -415,6 +418,11 @@ func (h *HyperKit) buildArgs(cmdline string) {
|
||||
nextSlot++
|
||||
}
|
||||
|
||||
if h.VMNet {
|
||||
a = append(a, "-s", fmt.Sprintf("%d:0,virtio-net", nextSlot))
|
||||
nextSlot++
|
||||
}
|
||||
|
||||
if h.UUID != "" {
|
||||
a = append(a, "-U", h.UUID)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user