KVM: Difference between revisions

From Wildsong
Jump to navigationJump to search
Brian Wilson (talk | contribs)
mNo edit summary
Brian Wilson (talk | contribs)
mNo edit summary
Line 2: Line 2:
It is not locked to a Gui; this makes it more suitable for use on servers.  Along the same line,  
It is not locked to a Gui; this makes it more suitable for use on servers.  Along the same line,  
it automatically sets up a virtual console using SPICE(http://www.spice-space.org/) or VNC. This allows out of band
it automatically sets up a virtual console using SPICE(http://www.spice-space.org/) or VNC. This allows out of band
access to a virtual machine.
access to a virtual machine, sort of like [[IPMI]].


I am testing it on [[Dart]], a server that runs Debian 7.  
I am testing it on [[Dart]], a server that runs Debian 7.  
Line 37: Line 37:


  kvm -hda hupi.img -vnc :0 -device e1000,netdev=user.0 -netdev user,id=user.0,hostfwd=tcp::5555-:22 &
  kvm -hda hupi.img -vnc :0 -device e1000,netdev=user.0 -netdev user,id=user.0,hostfwd=tcp::5555-:22 &
=== Securing access ===
Seems quite open at the moment. I need my password in the guest, that's all.


== Bridged network ==
== Bridged network ==
Line 44: Line 48:
Change the host /etc/network/interfaces file. Restart networking.
Change the host /etc/network/interfaces file. Restart networking.


  # The primary network interface
  # Replace old eth0 config with br0
  auto eth0
  auto eth0 br0
iface eth0 inet manual
   
   
  auto br0
  # Use old eth0 config for br0, plus bridge stuff
  iface br0 inet dhcp
  iface br0 inet dhcp
        bridge_ports eth0
    bridge_ports   eth0
        bridge_stp off
    bridge_stp     off
        bridge_fd 0
    bridge_maxwait  0
        bridge_maxwait 0
    bridge_fd       0
 
So far, sudo service networking restart has worked for me! Even remotely, w no long bike rides to fix it.
(Also, I have IPMI access when I remember to plug in the extra ethernet cable.)


=== Guest ===
=== Guest ===
Line 61: Line 67:
SPICE
SPICE


VNC
VNC - I am using because it's built in. Once the machine is running properly I have no immediate need for a GUI console.


== Virtualbricks ==
== Virtualbricks ==

Revision as of 17:13, 21 March 2015

KVM is a virtualization engine, like VirtualBox or VMWare. It is not locked to a Gui; this makes it more suitable for use on servers. Along the same line, it automatically sets up a virtual console using SPICE(http://www.spice-space.org/) or VNC. This allows out of band access to a virtual machine, sort of like IPMI.

I am testing it on Dart, a server that runs Debian 7.

I want to migrate wildsong.biz and hupi.org to virtual machines so that I can host them on Dart but still keep them walled off in their own worlds to make them easier to manage.

Also I need to be able to run Ubuntu to test out BigBlueButton. (It seemed the easiest path at the moment.)

I now have a virtual machine set up but don't have the network connection going yet.

I am also working out the best console connection to use, SPICE looks cool. Checking that out today. 2/15/14 On my Mac I found that the native VNC connection did not work but that Vine VNC does. I looked at NoMachine a bit but it's not free.

Set up

Package installation

sudo apt-get install qemu-kvm

Use

Create a new virtual machine, then start it.

mkdir /var/kvm
cd /var/kvm
qemu-img create -f qcow2 hupi.img 10G
kvm -hda hupi.img -cdrom ~bwilson/LinuxImages/debian-7.8.0-amd64-netinst.iso -boot d -m 2048 -vnc :0 &

Now connect via VNC client. On my Mac, last year I downloaded Vine VNC Client. It made me jump through hoops. I just tried Chicken of the VNC and it's fine. http://sourceforge.net/projects/chicken/

One thing about using VNC server on Dart, I can connect and disconnect any time without worrying about the session state as I do when using ssh.

Starting the machine with some extra networking goodies

kvm -hda hupi.img -vnc :0 -device e1000,netdev=user.0 -netdev user,id=user.0,hostfwd=tcp::5555-:22 &

Securing access

Seems quite open at the moment. I need my password in the guest, that's all.

Bridged network

Host

Change the host /etc/network/interfaces file. Restart networking.

# Replace old eth0 config with br0
auto eth0 br0

# Use old eth0 config for br0, plus bridge stuff
iface br0 inet dhcp
   bridge_ports    eth0
   bridge_stp      off
   bridge_maxwait  0
   bridge_fd       0

So far, sudo service networking restart has worked for me! Even remotely, w no long bike rides to fix it. (Also, I have IPMI access when I remember to plug in the extra ethernet cable.)

Guest

Remote access

SPICE

VNC - I am using because it's built in. Once the machine is running properly I have no immediate need for a GUI console.

Virtualbricks

Looks quite promising but I need to get off Tektonic today so --- back burner.

http://virtualbricks.eu/wiki/index.php/Main_Page

Don't install from Debian, that version is old.

sudo apt-get install python-twisted

I get this error

virtualbricks.errors.InvalidNameError: /home/bwilson/.virtualbricks/.virtualbricks.vbl