LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-22-2016, 06:47 AM   #16
Slax-Dude
Member
 
Registered: Mar 2006
Location: Valadares, V.N.Gaia, Portugal
Distribution: Slackware
Posts: 528

Rep: Reputation: 272Reputation: 272Reputation: 272

Quote:
Originally Posted by kikinovak View Post
By the way, I've setup a Github repo for playing with KVM here: https://github.com/kikinovak/kvm
I was looking at the package list for the server and was wondering about what "six" and "device-tree-compiler" are used for: could you please explain?
 
Old 02-22-2016, 07:00 AM   #17
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Original Poster
Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Quote:
Originally Posted by Slax-Dude View Post
I was looking at the package list for the server and was wondering about what "six" and "device-tree-compiler" are used for: could you please explain?
I'm using a slightly more recent version of spice than the one on SlackBuilds.org, and six is an additional dependency for that. As for device-tree-compiler, it's an optional dependency for QEMU for guest architectures other than x86, like arm.

Niki
 
1 members found this post helpful.
Old 02-22-2016, 11:36 AM   #18
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Quote:
Originally Posted by Slax-Dude View Post
I was looking at the package list for the server and was wondering about what "six" and "device-tree-compiler" are used for: could you please explain?
Quote:
six: six (Python 2 and 3 compatibility utilities)
six:
six: Six is a Python 2 and 3 compatibility library. It provides utility
six: functions for smoothing over the differences between the Python
six: versions with the goal of writing Python code that is compatible on
six: both Python versions. See the documentation for more information on
six: what is provided.
six:
six: Homepage: http://pypi.python.org/pypi/six/
six:
six:
Quote:
device-tree-compiler: device-tree-compiler (Device Tree Compiler for Flat Device Trees)
device-tree-compiler:
device-tree-compiler: Device Tree Compiler, 'dtc', transforms a textual description of a
device-tree-compiler: device tree ('DTS') into a binary object ('DTB').
device-tree-compiler:
device-tree-compiler: DTS is most commonly used on embedded platforms.
device-tree-compiler:
device-tree-compiler: This tool is particularly useful for building a DTS-enabled 'U-Boot'
device-tree-compiler: binary.
device-tree-compiler:
device-tree-compiler:
The latter may not be enlightening.
 
Old 02-24-2016, 06:35 AM   #19
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Original Poster
Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
I just installed a fresh headless (e. g. booting to runlevel 3) KVM host using Slackware64 14.1. On my workstation I also have Slackware64 14.1 with virt-manager. I tried to create a virtual machine (also Slackware64 14.1), but here's the error message I get when launching the installation:

Code:
could not get a reference to type class
I've added a screenshot so you can see a little bit of context.

I've googled a bit, but to no avail. Now I'm clueless. Any idea what's going on?

Cheers,

Niki
Attached Thumbnails
Click image for larger version

Name:	kvm-error.png
Views:	45
Size:	207.4 KB
ID:	20936  
 
Old 02-24-2016, 07:47 AM   #20
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Original Poster
Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
I eventually tried the MCSE (Microsoft Certified Solitaire Engineer) approach. I randomly restarted the remote server and the local workstation, until everything suddenly worked without any apparent reason.
 
Old 02-24-2016, 10:38 AM   #21
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Original Poster
Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Right, this seems to work so far. The next problem I have to solve is networking. Here's what I have so far.
  • On the KVM guest (Slackware64.14.1) I only have the lo interface. 'ifconfig -a' shows nothing else.
  • On the KVM host (Slackware 64.14.1) I have lo, eth0, virbr0 and vnet0. eth0 is 192.168.2.10 (my LAN being 192.168.2.0/255.255.255.0), virbr0 shows 192.168.122.1 and vnet0 is not affected.

I'd like my KVM guest to be a part of my local 192.168.2.0/255.255.255.0 subnet. I know how to configure this with VirtualBox, but I don't know how to achieve this with QEMU/KVM. After googling some, I admit I'm completely confused. In VirtualBox, I just select "Access by bridge" (Accès par pont), check out or redefine the guest's MAC address and then, on my LAN server, edit dnsmasq.conf to give the same hostname/IP address to the virtual system according to its MAC address. How is this done with QEMU/KVM?

Cheers,

Niki
 
Old 02-24-2016, 11:06 AM   #22
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,096

Rep: Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173
regarding the guest the interfaces avalaible depend on the ones you assign it: I usually assign a virtual ethernet interface using "virtio" as its driver (it's the fastest one).
then the guest takes care of loading the virtio_net kernel module at boot.

regarding the libvirt host I usually define the bridged networks in /etc/rc.d/rc.inet1.conf: following your example I configure it like this (leaving the top definitions of the interfaces blank)
Code:
GATEWAY="192.168.2.1"
IFNAME[0]="br0"
BRNICS[0]="eth0"
IPADDR[0]="192.168.2.10"
NETMASK[0]="255.255.255.0"
this way I have an additional bridge br0 on my local network to use for my virtual machines.

Last edited by ponce; 02-24-2016 at 11:15 AM.
 
1 members found this post helpful.
Old 02-24-2016, 02:19 PM   #23
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748
There is an old thread on this. http://www.linuxquestions.org/questi...ox-4175431859/
I am still using the stuff in post#5 of that thread, the only difference being that tunctl is now part of Slackware, so now it does not need to be installed.
 
2 members found this post helpful.
Old 02-25-2016, 01:38 AM   #24
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Original Poster
Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Quote:
Originally Posted by ponce View Post
regarding the guest the interfaces avalaible depend on the ones you assign it: I usually assign a virtual ethernet interface using "virtio" as its driver (it's the fastest one).
then the guest takes care of loading the virtio_net kernel module at boot.

regarding the libvirt host I usually define the bridged networks in /etc/rc.d/rc.inet1.conf: following your example I configure it like this (leaving the top definitions of the interfaces blank)
Code:
GATEWAY="192.168.2.1"
IFNAME[0]="br0"
BRNICS[0]="eth0"
IPADDR[0]="192.168.2.10"
NETMASK[0]="255.255.255.0"
this way I have an additional bridge br0 on my local network to use for my virtual machines.
I experimented a little bit with that setup. Here's what I have on my KVM host (which gets an invariable IP from the local Dnsmasq server):

Code:
# Config information for br0::
IFNAME[0]="br0"
BRNICS[0]="eth0"
IPADDR[0]=""
NETMASK[0]=""
USE_DHCP[0]="yes"
DHCP_HOSTNAME[0]=""
Then on every KVM guest I have this configuration:
  • NIC :XX:YY:ZZ > Network source: Bridge br0: Host device eth0
  • Device model: virtio
  • MAC address: 52:54:00:XX:YY:ZZ

Then again, I can assign an invariable IP address within my network on the Dnsmasq server.

This seems to be the most "keep it simple" solution for what I want, e. g. various virtual machines to build stuff on different versions of Slackware. When I launch such a virtual machine, it can communicate (ping, scp, etc.) with all the local machines, and in return all the local machines can communicate with this virtual machine.

Since the main use of these different virtual machines is to build stuff, it would make no sense to launch several of these at a time. Just for the fun of it, I tried to assign different IP addresses and hostnames via Dnsmasq (kvmguest-1 and kvmguest-2) to two virtual machines and launch them at the same time. They can still communicate with the local network, and the local network can communicate with them. On the other hand, I get some weird results when they try to communicate between themselves. kvmguest-1 can communicate with kvmguest-2, but not the other way around. If there's a simple (!) solution to that, I'd be curious to know. On the other hand, it's not really a big deal, since I already have what I want for my specific use case.

Two other questions came up during my tests.
  1. On a headless (runlevel 3) server installation, I only start with rc.syslog and rc.sshd services activated. On the other hand, a stock Slackware (desktop) installation also activates rc.fuse, rc.inetd and rc.messagebus. I didn't know which one of these services would actually be needed by a headless KVM host, so I activated all three just to make sure that wouldn't make a problem. Q: which services are actually needed on a KVM host?
  2. On the KVM host, I have created a 'kikinovak' user who's not only a member of 'users', but also of all the extra groups like audio, video, cdrom, plugdev, etc. When I connect to the remote KVM host with virt-manager, I do so via SSH and as user 'kikinovak'. Now I wonder if membership to these extra groups would be a requirement, or if the 'users' group would be sufficient. In doubt, I added the user to all the extra groups.

Cheers,

Niki

Last edited by kikinovak; 02-25-2016 at 01:39 AM.
 
Old 02-25-2016, 08:11 AM   #25
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748Reputation: 2748
Quote:
If there's a simple (!) solution to that, I'd be curious to know.
I would try putting all the virtual machines on a virtual switch using vde2. https://www.slackbuilds.org/reposito.../network/vde2/
Q1. I would maintain the rc.fuse, rc.inetd and rc.messagebus so that these are services available on the server.
Q2. A virtual machine is like a physical machine. Set the groups as you would for a physical machine.
 
1 members found this post helpful.
Old 02-25-2016, 10:00 AM   #26
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,096

Rep: Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173
Quote:
Originally Posted by kikinovak View Post
Q: which services are actually needed on a KVM host?
there's no fixed answer: the ones you need. I too usually enable just the two you cited.
Quote:
Now I wonder if membership to these extra groups would be a requirement, or if the 'users' group would be sufficient.
the second you said: you can also change the default group the libvirt user must be in from the default "users" modifying the "unix_sock_group" option in /etc/libvirt/libvirtd.conf and the "group" option in /etc/libvirt/qemu.conf.

Last edited by ponce; 02-25-2016 at 10:02 AM.
 
1 members found this post helpful.
Old 02-26-2016, 04:17 AM   #27
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Original Poster
Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
I've been making some nice progress over the last few days, and my KVM-related TODO list is almost complete. This morning I managed to successfully migrate KVM guests from one hypervisor to another. Now I have some more questions left.

1. I wonder how it is with host vs. guest compatibility? Let's say I have a KVM host running Slackware 14.1 or even -current. Could it theoretically be possible to install some older or even obsolete stuff on this, like Slackware 9.x, CentOS 3.x? The reason I'm asking this is: I wonder if my virtual machines with Slackware 14.0 will still be supported by a KVM host in five or six years.

2. On the other hand, can my KVM host be slightly outdated and support future Linux versions? Let's say I have a KVM host running Slackware64 14.0 (which is the case on my main public server). Can I reasonably expect this to run virtual machines with the upcoming Slackware 14.2 and even one or two versions after that? Or will I have to upgrade my KVM host at some point before it reaches EOL?

3. Something completely different concerns container image size. When I define a virtual machine with a size of 20 GB, the corresponding container image size is exactly that, even though the installation is a reduced set of Slackware packages:

Code:
# ls -lh *.qcow2
-rw-r--r-- 1 root root 21G févr. 25 14:07 MLES-14.0-32bit.qcow2
-rw-r--r-- 1 root root 21G févr. 26 10:14 MLES-14.1-64bit.qcow2
Is there any way to reduce the size of these images to something like the space that is actually used? I'm starting to think about how I will manage my backups.

Cheers,

Niki
 
Old 02-26-2016, 04:32 AM   #28
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,096

Rep: Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173Reputation: 4173
1 and 2: I suppose there will be no problems, as long as the virtualized hardware is supported by whatever you install on it.

3: I suppose you are using the virt-manager interface to create the vm disk images, that by default preallocates the files for their full size.
you can also manually create them with qemu-img (and later assign them to the vm using the virt-manager interface) so that they will be allocated only for the effectively used space: that space will grow including modifications to the filesystem until reaching the defined size.
Code:
$ qemu-img create -f qcow2 s64c.qcow2 50G
Formatting 's64c.qcow2', fmt=qcow2 size=53687091200 encryption=off cluster_size=65536 lazy_refcounts=off refcount_bits=16
$ ls -lah s64c.qcow2
-rw-r--r-- 1 myuser users 193K Feb 26 11:31 s64c.qcow2
 
1 members found this post helpful.
Old 02-26-2016, 05:49 AM   #29
Slax-Dude
Member
 
Registered: Mar 2006
Location: Valadares, V.N.Gaia, Portugal
Distribution: Slackware
Posts: 528

Rep: Reputation: 272Reputation: 272Reputation: 272
If you open a VM and choose to add hardware, then select storage, you get the option to either allocate the whole space or not.
Attached Thumbnails
Click image for larger version

Name:	snapshot1.png
Views:	27
Size:	72.8 KB
ID:	20961  
 
Old 02-26-2016, 06:30 AM   #30
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Original Poster
Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Quote:
Originally Posted by Slax-Dude View Post
If you open a VM and choose to add hardware, then select storage, you get the option to either allocate the whole space or not.
That option is greyed out in my Virt-Manager.
Attached Thumbnails
Click image for larger version

Name:	storage.png
Views:	25
Size:	74.0 KB
ID:	20962  
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Experimenting with KVM and the kernel ramzi.kahil Linux - Kernel 0 04-26-2014 11:45 AM
LXer: Set up qemu-kvm-1.0+noroms as spice enabled qemu server vs qemu-kvm-spice on Ubuntu Precise LXer Syndicated Linux News 0 05-26-2012 07:41 AM
[Debian/Qemu/KVM] Why qemu --enable-kvm works but not kvm directly? gb2312 Linux - Virtualization and Cloud 2 03-21-2011 02:05 PM
LXer: Attempt of qemu-kvm-0.14 patching via Gerd’s Hoffmann “spice/qxl: locking fix for qemu-kvm” on LXer Syndicated Linux News 0 03-14-2011 01:20 PM
On qemu-kvm, qemu-ifup script not found on Slackware 13 AndrewGaven Linux - Virtualization and Cloud 14 01-29-2010 03:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration