Author Topic: LMCE 810 core installation in KVM Virtual Machine  (Read 12769 times)

danielmayer

  • Regular Poster
  • **
  • Posts: 35
    • View Profile
LMCE 810 core installation in KVM Virtual Machine
« on: May 26, 2009, 01:00:39 pm »
Hi all,
now for the first time I'm perhaps able to give st. to the community instead of always asking ;)

"mini-howto" for a LMCE-core in a VM: (please read it fully before beginning as its "golden thread" is not straight ;))

My server:
Tyan n6650w, currently one Quad-Opteron 2352, 8GB RAM, 8x1TB HDDs at an Adaptec 2820SA, ATI 2600XT. The server has uses a Technisat Skystar HD2.

Very Important: The Host-CPU(s) needs to support VT-d (Intel) or AMD-V (AMD). The Barcelona-Opterons are quite fine for this. I did not look up for other CPUs, but newer AMD should all have this feature.
My "Host", as the physical server ist to be called in this text, runs at Kubuntu 9.04 x64, patched with latest updates. You can choose the "type" (x32/x64) for each virtual machine individually, so it does not hinder LMCE-x32.

1) Set up your Host/Server with any Linux that supports hardware-KVM. Kubuntu 9.04 is nice as it features the latest KVM-packages. Install all KVM packages, if not already. Install and use "virt-manager" on KDE for an easy installation of a Kubuntu 8.10 guest, but install the VM in the "System" section, as it gives a necessary NIC-option: Bridged-Mode for the NIC! If there's no "System" available, start virt-manager from the console "virt-manager -c qemu://meinserver/system"

1a) In the install options, when assigning the NIC, take "bridged mode -> share physical network (eth0)". You can assign it later an IP in the "normal" network-range, LMCE will detect and configure quite fine a kind of double-bridge which runs smoothly.

1b) Install the guest-Kubuntu as usual now. I recommend saving the "pure" Kubuntu guest for faster recovery if st. does not work later.

1c) After installation, start the VM and look if everything is ok. I recommend to assign the 192.168.80.x IP-range to every PC in the house or change the LMCE-install-files...
My Host uses 192.168.80.254. Assign the virtual Kubuntu e.g. the IP 192.168.80.252, netmask 255.255.255.0, gateway [Host-IP, in this example 192.168.80.254] and do all the updates. I strongly recommend to shut down every DHCP-server as the LMCE-core, installed in the next step, should be the only one in the LAN.

1d) Install LMCE in the VM as usual. I recommend to edit the installer-files before starting the installation with the current usage: "vim mce_wizard_data-single_nic.sh", set device-type to Core, Ext-DHCP no, run dhcp-server yes and put in the IP-values for your "external" network, see above.
When the installer has finished and restarts the VM, it should run quite fine. The pluto-admin page should be available from every PC in the house with the standard address (192.168.80.1 or .252 in this example). As it happens, the VM will use two IPs, the one assigned in 1c) and the .1-default IP. Not necessary, but it does no damage.

It's now time to put the TV-card(s) into the VM.

2) Grab the 2.6.30-rc7 (the latest available) source, unpack it on the Host to e.g. /usr/src/linux-2.6.30-rc7 and do a "make menuconfig"

3) Follow the instructions in: http://www.linux-kvm.org/page/How_to_assign_devices_with_VT-d_in_KVM to assign the card to the virtual machine. I tried those instructions for many times without success because they miss to state that a 2.6.30.x-kernel is needed!!
- I tried the 2.6.29.4, but it misses the pci-reset-ability or anything else. 2.6.29. is bad, 2.6.30 is your friend.

3a) After compiling and installing the new kernel, enter /etc/libvirt/qemu and search for your VMs' .xml file. Edit it (e.g. "vim lmce810.xml") and add the following lines:
    <hostdev mode='subsystem' type='pci'>
        <source>
        <address bus='0x01' slot='0x04' function='0'/>   
        </source>
    </hostdev>
Of course, you need your own values. My card is located at 01:04.0, so simply adapt it to your needs.
Save the file and do the reboot with the new kernel.
(you can do this step any time, but you need a restart of the libvirt to load the edited .xml; simply restarting virsh/virt-manager isn't enough)

4) After you now did the remaining steps of the KVM-link above (3-6), test if everything is ok:
- kernel 2.6.30.x is running on the Host?
- do a "lspci -v" on the Host. The DVB-card should now list the driver "pci-stub"

5) start up the VM-LMCE. Login on the ususal ways, e.g. via putty from any Windows-PC. On the VM, do a "lspci". The dvb-card should be present.

8) Install the drivers for the dvb-card on the VM and have fun.

----

It's a crude howto, but those of you with some linux knowledge should get the points. When setting up the whole system again, I'll take some screenshots to give a "nice" Howto. Please excuse the bad englisch, I lack the practise...

This should be possible with multiple PCI-cards. It may even possible *only* with all PCI-cards, as the KVM-Howto mentions that all PCI-devices behind a bridge need to be assigned in whole.
I did shutdown the firewire-port in BIOS to have the DVB-card as the only device behind a bridge on my mainboard.
If you experience problems which sound like this, try "lspci -t" on the Host and have a look for your DVB-cards.
On my Host it looks (now, after disabling firewire) like:
-[0000:00]-+-00.0
           +-01.0
           +-01.1
           +-02.0
           +-02.1
           +-04.0
           +-05.0
           +-05.1
           +-06.0-[0000:01]----04.0                                           (<- DVB-card)
           +-06.1
           +-08.0
           +-09.0
           +-0d.0-[0000:02-04]--+-00.0-[0000:03]----04.0
           |                    \-00.1-[0000:04]--
           +-0f.0-[0000:05]--+-00.0
           |                 \-00.1
           +-18.0
           +-18.1
           +-18.2
           +-18.3
           \-18.4

------------------------------

I used many, many days to get this working, so don't give up! I got it working and so can you.
And if someone asks "why the hell....": I use another VM with Windows Server+Exchange Server and the Host hosts as internal file server... other applications may come in future.
- and the weekly LMCE-experiments "8.10" do not interfere with the normal server services ;)

Pehaps a Wiki-Page would be nice? I'd do the first text ;)

Greetings!
Server: Ubuntu 10.04A2, 1xL5520 on Asus Z8-PED12X, 12GB, 300GB U320Raid0, 8TB HDDs@Adaptec 2820SA + 8TB@Perc 5/E. LMCE via KVM (running); other VMs;
Workstation: W7x64, 2xOpteron 2376, 24GB, 146 GB-SSD-Raid0, ATI 4850
MD: Asrock nv630i, 2GB

danielmayer

  • Regular Poster
  • **
  • Posts: 35
    • View Profile
Re: LinuxMCE 810 core installation in KVM Virtual Machine
« Reply #1 on: May 27, 2009, 09:28:00 am »
I forgot to mention, that the Host-NIC needs to be set up as bridge:

(/etc/network/interfaces:)

auto br0
iface br0 inet static
    address 192.168.80.254
    netmask 255.255.255.0
    network 192.168.80.0
    broadcast 192.168.80.255
    gateway 192.168.80.100            (<-my WAN-Router, if you use a second NIC for Internet, remove line)
    dns-nameservers 192.168.80.100 [dns2] [dns3]          (again, my router)
    bridge_ports eth0
    bridge_stp off
    bridge_fd 0
    bridge_maxwait 0

auto eth0
iface eth0 inet manual



This need to be done before installing Kubuntu as Guest, else you can't choose the "shared physical network (eth0)" in virt-manager.

Greetings,
Daniel
Server: Ubuntu 10.04A2, 1xL5520 on Asus Z8-PED12X, 12GB, 300GB U320Raid0, 8TB HDDs@Adaptec 2820SA + 8TB@Perc 5/E. LMCE via KVM (running); other VMs;
Workstation: W7x64, 2xOpteron 2376, 24GB, 146 GB-SSD-Raid0, ATI 4850
MD: Asrock nv630i, 2GB

danielmayer

  • Regular Poster
  • **
  • Posts: 35
    • View Profile
Re: LinuxMCE 810 core/hybrid installation in KVM Virtual Machine
« Reply #2 on: May 29, 2009, 09:17:53 am »
At Core-only installation, the KDE desktop does not run with my ATI. Startup has blank screen with cursor. Pluto-admin is accessible from any PC, switching to console is possible, but no X. I don't understand that. Perhaps the installation (I tried two times yesterday) does not finish correctly.

Instead the hybrid installation runs perfectly. UI1 is fine, system runs smoothly.
Server: Ubuntu 10.04A2, 1xL5520 on Asus Z8-PED12X, 12GB, 300GB U320Raid0, 8TB HDDs@Adaptec 2820SA + 8TB@Perc 5/E. LMCE via KVM (running); other VMs;
Workstation: W7x64, 2xOpteron 2376, 24GB, 146 GB-SSD-Raid0, ATI 4850
MD: Asrock nv630i, 2GB

Marie.O

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3676
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: LinuxMCE 810 core/hybrid installation in KVM Virtual Machine
« Reply #3 on: May 29, 2009, 09:30:48 am »
At Core-only installation, the KDE desktop does not run with my ATI.

Core only by definition does not run X

danielmayer

  • Regular Poster
  • **
  • Posts: 35
    • View Profile
Re: LinuxMCE 810 core installation in KVM Virtual Machine
« Reply #4 on: May 29, 2009, 04:33:56 pm »
Ah, ok. Thanks. That explains much ;)

So I'd have to run the filldatabase via console.
To post the latest news: PXE-booting of MD is fine, including NVidia-drivers and UI2 on 7050-chipset. So the VM-install has gone better than my last "real" installation  8)

I'm not quite sure about the PXE-over-Gb-LAN-performance, but I'll test that with some copy-actions. I'd put 8.10 into RC-status  :-X  :D
Server: Ubuntu 10.04A2, 1xL5520 on Asus Z8-PED12X, 12GB, 300GB U320Raid0, 8TB HDDs@Adaptec 2820SA + 8TB@Perc 5/E. LMCE via KVM (running); other VMs;
Workstation: W7x64, 2xOpteron 2376, 24GB, 146 GB-SSD-Raid0, ATI 4850
MD: Asrock nv630i, 2GB

schaferj

  • Veteran
  • ***
  • Posts: 133
    • View Profile
Re: LinuxMCE 810 core installation in KVM Virtual Machine
« Reply #5 on: September 01, 2009, 06:22:57 am »
I also noticed an updated wiki entry for building a lmce test environment on kvm.
http://wiki.linuxmce.org/index.php/Kvm
You may find this helpful.
joseph

danielmayer

  • Regular Poster
  • **
  • Posts: 35
    • View Profile
Re: LinuxMCE 810 core installation in KVM Virtual Machine
« Reply #6 on: September 03, 2009, 12:03:24 pm »
Ah, yes. Thanks. I edited/added my experiences. Especially for the beta-testing, this KVM solution has been a great help to retain a stable server. ::)
Adding to an existing Wiki saves my time ;)
Server: Ubuntu 10.04A2, 1xL5520 on Asus Z8-PED12X, 12GB, 300GB U320Raid0, 8TB HDDs@Adaptec 2820SA + 8TB@Perc 5/E. LMCE via KVM (running); other VMs;
Workstation: W7x64, 2xOpteron 2376, 24GB, 146 GB-SSD-Raid0, ATI 4850
MD: Asrock nv630i, 2GB