Skip to content

RKVM #1455

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

RKVM #1455

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 42 additions & 4 deletions doc/content/articles/vmtypes.article
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ The minimega authors

* Introduction

This document describes the two virtual machine (VM) types minimega is capable
of launching - QEMU/KVM virtual machines and containers. minimega uses a common
API to describe features and supports launching experiments consisting of both
types of VM.
This document describes the various virtual machine (VM) types minimega is capable
of launching - QEMU/KVM virtual machines, containers, and RKVM. Minimega uses
a common API to describe features and supports launching experiments consisting
of multiple types of VM.

* A quick example

Expand Down Expand Up @@ -188,3 +188,41 @@ To better work with systemd-based systems, minimega requires the cgroup hierarch
mount -t cgroup cgroup -o memory /sys/fs/cgroup/memory
mount -t cgroup cgroup -o freezer /sys/fs/cgroup/freezer
mount -t cgroup cgroup -o devices /sys/fs/cgroup/devices

** RKVM Remote Keyboard Video Mouse

minimega supports booting `rkvm` type VMs by using a vnc interface. When launching
`rkvm` type VMs, minimega will use the configuration provided in the `vm`config`
API.

*** RKVM-specific configuration parameters

Most `vm config` parameters are common to all VM types, however since RKVM
does not actually build a VM but rather an interface only a few specfic
parameters apply. See the[[/articles/api.article][minimega API]] for
documentation on specific configuration parameters.

Configuration parameters specific to `RKVM` instances:

- `vnc_host` - Configure the hostname or ip address that hosts the vnc interface
- `vnc_port` - Configure the tcp port that hosts the vnc interface

*** Example

.mega vmtypes/example2.mm

*** Technical details

When launching `rkvm` type VMs, the following occurs, in order:

- A new VM handler is created within minimega, which is populated with a copy of the VM configuration
- An instance directory for the VM is created (by default /tmp/minimega/N, where N is the VM ID), and the configuration is written to disk
- Checks are performed to ensure there are no conflicts in names or duplicate connections
- After a successful VNC connection, the VM is put into the BUILDING state, otherwise the VM is put in the ERROR state
- minimega returns control to the user

RKVM extends the Minimega VNC api to remotely connect to standalone VNC servers. This enables keybuffer and framebuffer recording, as well as VNC automation to external assets with Minimega.

RKVM has had limited testing against ESXI and x11vnc. Multiple connections are used and you will need to use the --shared and --forever switches with x11vnc.

Currently only VNC servers allowing RAW encoding are supported, VNC servers configured to force other encodings like TIGHT will not work.
17 changes: 17 additions & 0 deletions doc/content/articles/vmtypes/example2.mm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#Configure RKVM for vnc endpoint
vm config vnc_host 192.168.1.201
vm config vnc_port 5900

#launch
vm launch rkvm foo

#configure vnc endpoint using another VNC server
vm config vnc_host 192.168.1.202
vm config vnc_port 5900

#launch
vm launch rkvm bar

#start
vm start foo
vm start bar
2 changes: 2 additions & 0 deletions src/minimega/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,8 @@ func (vm *ContainerVM) Conflicts(vm2 VM) error {
return vm.ConflictsContainer(vm2)
case *KvmVM:
return vm.BaseVM.conflicts(vm2.BaseVM)
case *RKvmVM:
return vm.BaseVM.conflicts(vm2.BaseVM)
}

return errors.New("unknown VM type")
Expand Down
2 changes: 2 additions & 0 deletions src/minimega/kvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,8 @@ func (vm *KvmVM) Conflicts(vm2 VM) error {
return vm.ConflictsKVM(vm2)
case *ContainerVM:
return vm.BaseVM.conflicts(vm2.BaseVM)
case *RKvmVM:
return vm.BaseVM.conflicts(vm2.BaseVM)
}

return errors.New("unknown VM type")
Expand Down
Loading