LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 05-30-2015, 12:18 PM   #16
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142

Quote:
Originally Posted by dyasny View Post
This isn't PCI passthrough, this is GPU passthrough, and it's quite simple with vfio. Regular PCI passthrough is even simpler, no rocket science there
Interesting, thank you!
Found here an overview.
 
Old 05-30-2015, 03:08 PM   #17
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Original Poster
Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Sorry for not replying to any of the posts here I'm actually just reading documentation on installing kvm.
I've been trying to figure out the networking portion of kvm, as I'm on a wireless network so I have to set my system to allow network to pass thru my wireless card.
I haven't attempted it yet, but will be trying it when time permits.
 
Old 05-30-2015, 04:43 PM   #18
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,900

Rep: Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050
Quote:
Originally Posted by EDDY1 View Post
Sorry for not replying to any of the posts here I'm actually just reading documentation on installing kvm.
I've been trying to figure out the networking portion of kvm, as I'm on a wireless network so I have to set my system to allow network to pass thru my wireless card.
I haven't attempted it yet, but will be trying it when time permits.
You have to create a tap device for each VM and set up an arp proxy. Then you can work around the wifi issue with KVM. Otherwise your arp packets will be lost between the VM and the router. Resulting in all traffic for your virtual machines being routed incorrectly on your network.

I haven't used this for a while but, these are some notes I took the last time I set up KVM on my laptop using wifi:

Code:
Create a vm image that is sized up to 10GB of space

  qemu-img create Debian_Wheezy.img -f qcow2 10G

Install an ISO Image to the img using a 750mb swap

  qemu-kvm -m 750 -cdrom ../ISO/Debian_Wheezy/debian-7.7.0-amd64-CD-1.iso -boot d Debian_Wheezy.img

--Or with a tap device

  qemu-kvm -m 750 -cdrom ../ISO/Debian_Wheezy/debian-7.7.0-amd64-CD-1.iso -boot d Debian_Wheezy.img  -net nic -net tap,ifname=tap0,script=no

Boot an image

  sudo qemu-kvm -m 2048 Debian_Wheezy.img

Boot an image with a tap device

  sudo kvm -net nic -net tap,ifname=tap0,script=no -m 2048 Debian_Wheezy.img
Here is a very basic script I used to manage the tap device:

Code:
#!/bin/sh

tunctl -u mralk3
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/conf/wlan0/proxy_arp
echo 1 > /proc/sys/net/ipv4/conf/tap0/proxy_arp

ip link set tap0 up

route add -host 192.168.x.x dev tap0
It worked like a charm. I didn't explore any way to automate this. I suppose it would make sense to pass the user, interfaces, and ip address to the script as arguments.

Someone please correct me if this is incorrect, it has been a while since I used those notes or the script.

EDIT:
I believe you also need to set the IP address of the VM to a static address.

EDIT2:
I have tested this on Debian and Slackware, it works.

Last edited by mralk3; 05-30-2015 at 06:50 PM.
 
Old 05-30-2015, 11:45 PM   #19
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Original Poster
Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
@mralk3 when I try to setup vm it sys there's no network so I must setup networking first(I believe).
 
Old 05-31-2015, 07:49 AM   #20
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,900

Rep: Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050
Quote:
Originally Posted by EDDY1 View Post
@mralk3 when I try to setup vm it sys there's no network so I must setup networking first(I believe).
Yes, #1 you need your wifi card on the host connected to your access point. #2 you create the tap0 device. #3 You create the virtual machine, #4 you boot the virtual machine with the tap0 device connected, #5 you set the static ip that is the static route you added for the tap0 device on the host, in the virtual machine.

Keep in mind that if the static ip you use as the host route is 192.168.1.240, then that is the ip address used in the virtual machine. In the virtual machine, you then set the netmask to 255.255.255.0, broadcast address to 192.168.1.255 and default gateway to 192.168.1.1 or 192.168.1.254. (depending on how your network is set up)

The default gateway is your router. You can set the nameservers to be the same as your router if it has DNS services, to Google DNS services, or what I like to do: install DNSMASQ on the host machine and point all virtual machines to the host for DNS look ups.
 
Old 06-01-2015, 11:32 AM   #21
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Original Poster
Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
I have successfully installed kvm & configured it tu use my wifi card, theonly thing is now when I boot machine it no longer connects to wireless automatically.
It doesn't show my AP in list of available networks & to connect to it I had to go into networks & select the hidden network.
Also where is the default location for vm's, because when I was creating virtual drive it prompted me that the target only had 1.3G available. I changed the location to /home/user/vm but it took 2 tries for it to allow me to do it.
 
Old 06-01-2015, 12:44 PM   #22
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,900

Rep: Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050Reputation: 1050
Quote:
Originally Posted by EDDY1 View Post
I have successfully installed kvm & configured it tu use my wifi card, theonly thing is now when I boot machine it no longer connects to wireless automatically.
It doesn't show my AP in list of available networks & to connect to it I had to go into networks & select the hidden network.
Also where is the default location for vm's, because when I was creating virtual drive it prompted me that the target only had 1.3G available. I changed the location to /home/user/vm but it took 2 tries for it to allow me to do it.
I am assuming you are running Debian.

If you are using NetworkManager you will need to adjust your settings so that your wifi card connects automatically. NetworkManager might be confused about what network card to use as default with the new virtual interfaces created by KVM. Additionally, I found NetworkManager to be buggy with my wifi card and was forced to use the NetworkManager CLI to configure wifi. The command for that is nmcli, which as it turns out, is much faster to use than the nm-applet gui to configure any interface using NetworkManager.

I believe the default location that Debian uses to store KVM images is: /var/lib/libvirt/images/

You can find more information at the following links, should get you started on the right path.
  1. https://wiki.debian.org/KVM
  2. https://wiki.debian.org/DebianKVMGuests
 
Old 06-01-2015, 12:56 PM   #23
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Original Poster
Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Then I need to adjust the size of /var.
After I get my network settinngs right.
 
Old 06-02-2015, 01:52 PM   #24
Ihatewindows522
Member
 
Registered: Oct 2014
Location: Fort Wayne
Distribution: Ubuntu 16.04 LTS
Posts: 616
Blog Entries: 2

Rep: Reputation: 166Reputation: 166
Quote:
Originally Posted by Pearlseattle View Post
Let's not forget that VirtualBox is an Oracle product - the Oracle corporation could decide anytime to stop support/development of VirtualBox and at that point you would have to hope that somebody forks it in some intelligent way, or otherwise you would have to re-implement everything.
And KVM is owned by Oracle's chief competitor.
https://www.redhat.com/promo/qumranet/

Red Hat could just as easily stop supporting KVM. Your point is moot.
 
Old 06-02-2015, 02:17 PM   #25
dyasny
Member
 
Registered: Dec 2007
Location: Canada
Distribution: RHEL,Fedora
Posts: 995

Rep: Reputation: 115Reputation: 115
Quote:
Originally Posted by Ihatewindows522 View Post
And KVM is owned by Oracle's chief competitor.
https://www.redhat.com/promo/qumranet/

Red Hat could just as easily stop supporting KVM. Your point is moot.
If you had any idea about how these things work, you'd not be saying stupid things like these. 80% of cloud deployments are using KVM, vendors such as H, IBM, Intel, Canonical and lots of others are heavily invested in KVM. Red Hat is a driving force indeed, but even if hell freezes over and they abandon KVM, there's lots of folks out there to keep it going.
 
1 members found this post helpful.
Old 06-02-2015, 02:29 PM   #26
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,841

Original Poster
Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Well the network returned to normal, so, now I have to adjust the size of my /var, so I can install vm's to default location.
I guess that is definitely a benefit over vbox since the vm's should be accessible to all users instead of just the 1 that created the vm.
 
Old 06-02-2015, 04:02 PM   #27
Pearlseattle
Member
 
Registered: Aug 2007
Location: Zurich, Switzerland
Distribution: Gentoo
Posts: 999

Rep: Reputation: 142Reputation: 142
Quote:
Originally Posted by Ihatewindows522 View Post
And KVM is owned by Oracle's chief competitor.
https://www.redhat.com/promo/qumranet/
Qumranet/RH is definitely not "Oracle's chief competitor" - you should rather target SAP.

Quote:
Red Hat could just as easily stop supporting KVM.
Yeah, any company or group of hackers could stop anyday working on anything.
For this particular sector I have the feeling that the likeliness of Oracle dropping VB would be definitely higher than RH dropping KVM.
Reason: virtualization doesn't belong to the core activities of Oracle, while it is kind-of-core for RH.
 
Old 06-02-2015, 04:43 PM   #28
Samsonite2010
Member
 
Registered: Apr 2015
Distribution: Debian
Posts: 267
Blog Entries: 1

Rep: Reputation: 117Reputation: 117
While the speculation is amusing, I do not think it is useful - you can back your own horse of course. Virtualbox is big - a huge user base. It has a robust desktop application for Linux, Mac and Windows, supports pretty much all VM file types and converts between them so you cannot really lose even if it was stopped. I do not think people realise how widely-used it is in the real world. I work in this industry, so I like to think I have a good idea.

PS I have no affiliation with VB or Oracle, in fact my company officially uses VMWare and pays for that, but I will still recommend VB to anyone who is starting out with VMs and I used it on all 3 platforms - the experience was good on all.

Last edited by Samsonite2010; 06-02-2015 at 04:46 PM.
 
1 members found this post helpful.
Old 06-03-2015, 04:34 AM   #29
gradinaruvasile
Member
 
Registered: Apr 2010
Location: Cluj, Romania
Distribution: Debian Testing
Posts: 731

Rep: Reputation: 158Reputation: 158
On the topic itself:
The KVM userspace is absorbed fully by QEMU.
http://wiki.qemu.org/KVM

Some points worth considering:

- KVM is already built in the kernel and standard distros include just abput everything you need. VirtualBox needs to "stick itself in" meaning some kernel modules are built during installation. If you use a newer kernel that has some relevant ABIs changed there are chances that they will not compile (depends on upstream developers) - this happened to me when i started using kernels built from git.
- KVM requires hardware virtualization extension on the CPU (intel VT-x or AMD-V / vmx or svm processor flags under Linux). Virtually all CPUs have these features nowadays.
- if you have IOMMU extensions on the chipset+cpu (intel VT-d or AMD-Vi) you can use hardware PCI passthrough (probably all PCI devices including video cards, only that video card passthrough can be tricky).
- You can use even full block devices (including physical HDDs - tested myself) for storage.
- KVM too has USB device passthrough.
- If the guest is running linux, you can use file system passthrough via 9p. Although not available for Windows guests.
- KVM can be used in conjunction with libvirt: and can be managed by the graphical virt-manager utility, both are in the repos of just about any contemporary linux distro. Using them you will have:
-- A daemon that supervises the running virtual machines and stores their settings in xml files. The machines are started in the background, and you can connect to their console with virt-manager. This way they dont depend on the X server. You can have virtual machines auto started on boot, the machines are shut down orderly before shutdown/reboot.
-- Additionally libvirt can be accessed on remote machines tunneled via ssh. Virt-manager too can use these types of connections (built in feature), you can even export your local USB devices through network, connecting them to a VM that runs on another computer.
-- A graphical UI that works much in the same way as the VirtualBox one. If you use the qxl virtual video card and the user space vdagent, you can have dynamic resolution switching and clipboard sharing.
-- Linux guests work better than Windows.

Now on the downside:
- the best virtual video card (qxl) offers no hardware acceleration while virtualbox' card does (which is mostly emulation i suppose). I migrated machines from VBox to KVM (i use virt-manager) and they work just fine and i see no problems with the display - note that i use them for testing stuff that do not require hardware acceleration.
- With virt-manager you have to have a bridge pre-made (although you can create in the libvirt preferences) whereas VBox creates it for you on the fly (it behaves like VBox used to in older versions). Using NAT works just as with VBox but no port forwarding helpers from the GUI.
 
1 members found this post helpful.
Old 06-25-2015, 01:55 PM   #30
DJOtaku
Member
 
Registered: Oct 2004
Location: USA
Distribution: Fedora 25;CentOS 7; Kubuntu; Debian
Posts: 860

Rep: Reputation: 37
I don't know if you're still looking for an answer, OP - it seems you've started playing with KVM already. But for completeness sake, let me add my $0.02.

I've been a LONG time user of Virtualbox - since it was first introduced as a competitor to VMWare. About 4 years ago I started playing with KVM via virt-manager. At the time I wrote this blog post: http://www.ericsbinaryworld.com/2011...chine-manager/

I used to use VirtualBox A LOT to do Linux Distro reviews - at least one per month - sometimes more.

In the meanwhile, both bits of software have improved. Now, as the OP has learned, bridging even works with NetworkManager!

At this point in time, my preference is strongly for Virt-Manager/KVM. Why? Four things - one is relatively minor.

1. Because of the way VirtualBox is packaged, if they release a new version you have to go install it manually. Only bugfixes are fixed via yum/dnf update. This is probably a good thing for having a consistent experience - what if they change something crucial that makes your VMs not work? (this is the minor complaint)
2. Just like nVidia cards, it needs a kmod to work correctly. Just like nVidia cards, this leads to suboptimal performance. Sometimes it leads to very annoying and hard to find issues. Other times, you just need to "recompile" the kmod - just a script.
3. The open source Virtualbox is missing stuff. Those things are closed source. They're free as in beer, but I've had LOTS of issues with them. They need to be reinstalled with every upgrade of VirtualBox and right now I have a Debian VM that has become borked because it's dependent upon an older version of the add-ons. (These are things like seamless mouse integration, USB 2.0, and some other stuff)
4. Finally, in my experience (on my hardware) Virt-manager/KVM tends to have better performance. My computer drags a lot less with KVM VMs; especially when I have more than one running. But, this is the most subjective and perhaps host/guest/hardware combinations that you have might lead to VirtualBox working better.
 
1 members found this post helpful.
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: VirtualBox Is Still Running Slower Than QEMU-KVM LXer Syndicated Linux News 0 01-09-2014 11:42 PM
KVM vs VirtualBox Robynsveil Linux - Virtualization and Cloud 4 05-06-2013 01:42 AM
Moving Windows XP from VirtualBox to KVM -- and crashing KenJackson Linux - Virtualization and Cloud 1 12-20-2011 05:19 PM
VirtualBox + KVM + Intel virtualization? How? concoran Linux - Virtualization and Cloud 1 12-30-2009 10:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 06:12 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