SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i'm setting up some virtual machines using slackware as the host (what else) and qemu. i'm working with virt-manager and it's less than nice (cannot pick some menu options, there isn't a nice way of disabling the network card, chooses qemu instead of kvm for the machine type....). what else is out there to use? how do you manage your virtual machines?
Location: Northeastern Michigan, where Carhartt is a Designer Label
Distribution: Slackware 32- & 64-bit Stable
Posts: 3,541
Rep:
I use VirtualBox (which is easy to enable or disable stuff in); sorry never tried anything else but VMware so I can't speak to gemu.
Be that as it may, my virtual machines are in a separate partition mounted to /var/lib/virtual (just because that's where I first did it for no particularly good reason). What this does is allow me to do a clean install of Slackware (13.37 is released, eh?) without overwriting the virtual machines -- you just don't format the partition when you're adding to fstab. That's something I'd do no matter what just 'cause backing the blasted things up somewhere is... well, say, difficult when they're 20G to larger and there are three or four of them. Of course a second drive works just fine, too.
i'm setting up some virtual machines using slackware as the host (what else) and qemu. i'm working with virt-manager and it's less than nice (cannot pick some menu options, there isn't a nice way of disabling the network card, chooses qemu instead of kvm for the machine type....). what else is out there to use? how do you manage your virtual machines?
When I used KVM I used scripts to set it all up.
First I loaded the necessary modules - kvm, kvm-intel, tun and dummy (I attached VIFs to the dummy interface on the host):
Then I created a bridge and attached the dummy interface to it:
Code:
# create a bridge and bring it up
echo "Create bridge and bring it up ... "
/usr/bin/sudo /sbin/ip addr flush dummy0
/usr/bin/sudo /sbin/ifconfig dummy0 0.0.0.0
/usr/bin/sudo /sbin/brctl addbr br0
/usr/bin/sudo /sbin/brctl stp br0 off
/usr/bin/sudo /sbin/brctl setfd br0 0
/usr/bin/sudo /sbin/brctl sethello br0 1
/usr/bin/sudo /sbin/brctl addif br0 dummy0
/usr/bin/sudo /sbin/ifconfig br0 172.16.1.40
sleep 5s
Then I generated a random MAC address for the guest:
Code:
# generate some random MAC addresses for the guest
echo "Generate random MAC addresses for guests ... "
ranmac0=$(echo -n DE:AD:BE:EF ; for i in `seq 1 2` ; do echo -n `echo ":$RANDOM$RANDOM" | cut -n -c -3` ;done)
After this I created a tap interface for the guest to use and I attached it to the bridge:
Code:
# create a TAP interface and add it to the bridge
echo "Create TAP interface ... "
/usr/bin/sudo /usr/sbin/tunctl -u gerard -g kvm -t tap0
echo "Bring TAP interface up ... "
/usr/bin/sudo /sbin/ip link set tap0 up
sleep 2s
echo "Add TAP interface to bridge ... "
/usr/bin/sudo /usr/sbin/brctl addif br0 tap0
And finally I started the virtual machine with the new tap0 as its VIF:
None of this is hard to learn and it gives you control over everything. Needless to say I was helped greatly by other users with all of these steps and most of it is taken from their work but the key thing is that I understand it. I would still be using Windows if I found the GUI as flexible and powerful as the shell in Linux/BSD.
Last edited by Gerard Lally; 04-29-2011 at 08:56 AM.
I use Qemu and to manage them I just set up aliases or scripts so I can just type 'freebsd' etc. in a term. Seems like the simplest way of doing it. Could also just add an item in fluxbox menu to do it too.
You could have aliases that say run qemu with nic support if you wanted I guess.
yeah... scripts/aliases seems so much better than some crappy virsh/virt-manager "solution". thanks for the examples! a bit of doco reading and i'll be ok. the problem i'm having now is that windows 7 doesn't work (without -no-kvm switch). it gives this error on startup:
Code:
kvm: vm entry failed with error 0x80000021
If you're runnning a guest on an Intel machine without
unrestricted mode support, the failure can be most likely
due to the guest entering an invalid state for Intel VT.
For example, the guest maybe running in big real mode
which is not supported on less recent Intel processors.
kvm_run returned -22
FYI, here I'm happy with virt-manager too
I'm using it on l33t building some additional packages with this sbopkg queue (through my slackbuilds.org fork for current where I updated some stuff, selectable in sbopkg - thanks again, slakmagik)
the only additional thing is that you have to create a symlink, to make libvirt able to find the qemu/kvm binary
Code:
ln -s /usr/bin/qemu-system-x86_64 /usr/bin/kvm
I use also lxc with some l33t containers in production, hope to find time to write something about it (I think I'll grab the occasion when I have to setup another node)
all of this is fine with the stock kernels in l33t: if you're using a custom kernel there are some module reccomendations (and in this case you should have a look at the docs).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.