Skip to content
This repository has been archived by the owner on Aug 3, 2020. It is now read-only.

BBVA/kvm: Partially based on RancherVM project #84

Open
ahoeg opened this issue Oct 6, 2016 · 1 comment
Open

BBVA/kvm: Partially based on RancherVM project #84

ahoeg opened this issue Oct 6, 2016 · 1 comment
Assignees

Comments

@ahoeg
Copy link

ahoeg commented Oct 6, 2016

Found that great project which looks like a improved RancherVM.

Generic container for launching a Virtual Machine inside a Docker container.
Features:

  • uses QEMU/KVM to launch the VM directly with PID 1.
  • Non libvirt dependant.
  • It attaches to the VM as many NICs as the docker container has.
  • The VM gets the original container IPs. The container gets non-conflicting IPs
  • Uses macvtap tun devices for best network throughput

Maybe RancherVM could be improved with some of the features (interface mapping, ...) from BBVA/kvm?

@strowi
Copy link

strowi commented Dec 2, 2016

This looks very interesting. I tried modifying the bbva-container to work with ranchervm, but it seems i have an error getting the container-details?

rancher_1 | 172.18.0.1 - - [02/Dec/2016 19:27:08] command: /var/lib/rancher/noVNC-0.0.2/cgi-bin/ranchervm "" rancher_1 | 172.18.0.1 - - [02/Dec/2016 19:27:09] Traceback (most recent call last): rancher_1 | File "/var/lib/rancher/noVNC-0.0.2/cgi-bin/ranchervm", line 433, in <module> rancher_1 | kvm_args = " ".join(container_details.get("Config").get("Cmd")) rancher_1 | TypeError rancher_1 |

"/var/lib/rancher/vm:/vm" is mounted in both containers, and i can see the vnc-socket in there. But the vm won't show up in the ranchervm index-page...

I only modified the startvm-script...

`
--- a/startvm
+++ b/startvm
@@ -29,6 +29,22 @@

: ${KVM_CPU_OPTS:="-m 1024 -smp 4,sockets=4,cores=1,threads=1"}

+TMPDIR=mktemp -d -t ranchervm.XXXXXX

  • if [ $? -ne 0 ]
  • then
  • echo Fail to create temporaily directory
  • exit 1
    +fi

+# If /vm does not exist, we still proceed with running KVM. We just
+# won't get a VNC console socket.
+if [ -d /vm ]; then

  • DOCKERID=cat /proc/self/cgroup | grep docker | awk -F/ '{print $NF}' | cut -f 2 -d - | cut -f 1 -d . | head -1
  • mkdir -p /vm/$DOCKERID
  • VNC="-vnc unix:/vm/$DOCKERID/vnc"
  • echo VNC server will listen on Unix socket /vm/$DOCKERID/vnc
    +fi

set -x

ContainsElement: checks if first parameter is among the array given as second parameter

@@ -288,4 +304,4 @@ if [[ "$ENABLE_DHCP" == 1 ]]; then
fi

echo "INFO: Launching $LAUNCHER -enable-kvm $KVM_BLK_OPTS $KVM_OPTS $KVM_VIDEO_OPTS $KVM_CPU_OPTS $KVM_ARGS $@ $KVM_NET_OPTS"
-eval exec $LAUNCHER -enable-kvm $KVM_BLK_OPTS $KVM_OPTS $KVM_VIDEO_OPTS $KVM_CPU_OPTS "$@" $KVM_NET_OPTS
+eval exec $LAUNCHER -enable-kvm $KVM_BLK_OPTS $KVM_OPTS $KVM_VIDEO_OPTS $KVM_CPU_OPTS "$@" $KVM_NET_OPTS $VNC

`

@cjellick cjellick self-assigned this Mar 3, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants