Jump to content

ichase

Recommended Posts

Been conversing with SecurityBreach via PM's, and thought I would bring this topic into the open forum for others reading to learn from.

I recently installed Arch Linux x86_64 on a Dell Lattitude E6500. This is a quad core Intel i5 with 8 GB of RAM. For work puposes, I need to have Windows. I have Windows 7 installed on a seperate partition but realized with the setup I have, that I am now equiped to run Windows in a Vitual environment without it adversaly effecting the functionality of Arch.

So I started with Virtual Box and installed 3 VMs. Windows 7 Pro 32 Bit, Windows XP Pro, and Linux Mint 14. The issue I was having was I could not get guest additions to properly install and my screen resolutions were terrible. Screen all streched.

 

SecurityBreach recommended to me using QEMU with KVM. The i5 processor supports vitualization so I enabled that in the BIOS and installed QEMU. Since v1.3.0, QEMU comes with KVM. Prior to that, you had to install the package qemu-kvm (which no longer exist)

 

So I started reading the QEMU Arch Wiki and reading some of the links that SecurityBreach provided and was able to get Windows XP installed and actually running. At this point, I was in the same boat as I was with VBox, the resolution was terrible but also, I did not have network (internet) access.

 

In accordance with the QEMU Arch Wiki, I installed the vde2 package and followed the guidance in getting the network up and running. When I started up the VM I still did not have network capability. I started the VM with:

qemu system x86_64 enable-kvm -hda winxp.img -net nic -net vde -m 2048

So at this point, I decided to tackle the resolution issue. SecurityBreach shared with me a topic he had started on the Arch Linux forums and was advised to install the VMWare packages outlined in the Wiki. I did this and added the appropriate line to my start command

ichase02@arch64 ~$ qemu system-x86_64 -enable-kvm -hda winxp.img -net nic -net vde vga vmware -m 2048

at this point the VM did NOT start and I received the following error:

qemu-system-x86_64: -net vde: Device "vde" could not be initialized 

So in accordance with the Wiki, I loaded the module "tun" and tried again with the same error.

So I thought for a moment and decided to remove the -net vde from the start up command which resulted in this error:

qemu-system-x86_64: -net nic: drive with bus=0 ,unit=0 (index=0) exists 

VM still did not start so essentially I am going from bad to worse. :hysterical:

 

I realize that this is a result of lack of knowledge on my part. I will admit sometimes I read the Arch Wiki's and develop that glaze over my eyes. :lol: and do not truly understand what it is they are trying to convay. Once again, that is just my lack of knowledge but for those of you who know me, I am a persistant son of a gun and except for CUPS, I don't quite.

 

Thanks ahead of time and always for your guidance and knowledge and education :)

 

Ian

Edited by ichase
Link to comment
Share on other sites

securitybreach

You should not need Tap/Vde for basic networking. For instance, I use this to start my Mint virtual machine:

qemu-kvm -hda Mint.img -net nic,model=virtio -net user,hostfwd=tcp:127.0.0.1:15000-:22-vga vmware -device intel-hda -device hda-duplex -m 4000

 

Networking

 

User-mode networking

 

By default, without any -netdev arguments, QEMU will use user-mode networking with a built-in DHCP server. Your virtual machines will be assigned an IP address when they run their DHCP client, and they will be able to access the physical host's network through IP masquerading done by QEMU. This only works with the TCP and UDP protocols, so ICMP, including ping, will not work.

This default configuration allows your virtual machines to easily access the Internet, provided that the host is connected to it, but the virtual machines will not be directly visible on the external network, nor will virtual machines be able to talk to each other if you start up more than one concurrently.

QEMU's user-mode networking can offer more capabilities such as built-in TFTP or SMB servers, or attaching guests to virtual LANs so that they can talk to each other. See the QEMU documentation on the -net user flag for more details.

However, user-mode networking has limitations in both utility and performance. More advanced network configurations require the use of tap devices or other methods.

https://wiki.archlin...QEMU#Networking

Link to comment
Share on other sites

Well I originally read that and did not have networking when I booted into the VM.

Now you have for your networking flags a lot more than what the wiki states:

model=virtio -net user,hostfwd=tcp:127.0.0.1:15000-:22

Did you somehow provide a static IP to your Mint VM using the port 22? Also what is model=virtio?

Also, what is this:

device intel-hda -device hda-duplex
Edited by ichase
Link to comment
Share on other sites

securitybreach
Did you somehow provide a static IP to your Mint VM using the port 22?

Sort of: http://wiki.qemu.org...ing_.28SLIRP.29

 

Also what is model=virtio?

 

KVM offers guests the ability to use paravirtualized block and network devices, which leads to better performance and lower overhead. For Windows, a paravirtualized network driver can be obtainedhere. FreeBSD has the ability to use virtio drivers since 10.0 (unreleased). A backport of the drivers are available in the port emulators/virtio-kmod for FreeBSD 8.3 and 9.0.

 

A virtio block device requires the option -drive instead of the simple -hd* plus if=virtio:

$ qemu-kvm -boot order=c -drive file=drive.img,if=virtio

https://wiki.archlin...ts_.28virtio.29

 

 

Also, what is this
-device intel-hda -device hda-duplex

Basically "-device intel-hda is needed to get sound to the host and "-device hda-duplex" allows me to use my mic on the virtual machine. It is not needed but I was testing out voice calling on Mint for someone.

 

BTW most of what I use was found on various posts on the Archwiki and after lots of troubleshooting, I got it work beautifully.

Link to comment
Share on other sites

I have been reading from numerous different threads and there must be 1001 different ways to launch the VM to achieve the same results. The kicker is, many of them are referencing qemu prior to v1.3.0

 

Hate to be an anoyance but the link you provided in regards to your network set up was as clear as mud. :hysterical: Maybe not to you, but to me.........."MUD" :lol:

 

I read some other threads and was going to look at launching this way. Not sure what will happen.

$ qemu-system-x86_64 -enable-kvm -hda  winxp.img -net nic,vlan=0,model=virtio -net user,vlan=0 vga vmware -m 2048 

 

Find out tonight if this will work or not. And what about USB, what needs to be added to the command to allow for the guest OS to read USB. I have not even gotten to that point yet. ;)

 

I can imagine once you FINALLY get everything set up EXACTLY the way you want, that qemu will be wonderful. Will definitely clone the partition AS SOON AS I get this working optimaly. :)

Edited by ichase
Link to comment
Share on other sites

securitybreach

I can imagine once you FINALLY get everything set up EXACTLY the way you want, that qemu will be wonderful. Will definitely clone the partition AS SOON AS I get this working optimaly. :)

 

Well you do you not need to clone anything. Just save the command you use to launch it, the command you used to build the image and the command for booting the iso to a text file.

Link to comment
Share on other sites

Josh, THANK YOU THANK YOU THANK YOU for all the assitance and links. For now, I am putting QEMU-kvm on the back burner as I was able to get WinXP for work purposes completely setup in VBox once I figured out how to get the Guest Additions added. I just keep it minimized on screen #2 and if something work related comes in, I just switch. Ain't trying to spend ANYMORE time in Windows than what is necessary. :hysterical:

Link to comment
Share on other sites

The guest additions package was included in the Mac version of VirtualBox and just mount it as a CD and install it within Windows.

 

Things are a bit different in Linux for it. And here's the Arch way: ArchLinux VirtualBox Guest Additions

 

I love VirtualBox.

Actually that is what I did. Downloaded the guest additions iso file, burned to CD and run it in XP, worked like a champ. Strange this is, I had a Win7 VM setup, installed the guest additions, but even though it was installed and the icon was showing on the bottom right of the screen, it was still not working. NOT a big deal as I can do everything I need for work from XP Pro :)

 

/me just loves virtual machines :D

So do I Rock, glad I finally have a machine that is powerful enough to run them smooth :thumbup:

Link to comment
Share on other sites

  • 3 weeks later...

Alright, giving QEMU another shot to run Linux VMs. Going to keep WinXP in VBox because it works absolutely great in VBox and is optimaly setup for work so I don't have to reboot into Win7.

 

So I started with LMDE, I created the VM in VBox as a qed VM per Josh's recommendation. I was able to launch it via QEMU minimalistically with a simple:

qemu-system-x86_64 -enable-kvm ~/LMDE.qed

Just to see if it would launch the VM, it did but of course it was a mess, video, networking etc was not working but I knew this would out the correct flags launched.

 

I read the QEMU Arch Wiki, installed xf86-video-vmware and xf86-input-vmmouse, modprobed the virtio_net module and attempted to launch with this:

$ qemu-system-x86_64 -enable-kvm -hda /home/ichase02/VirtualBox\ VMs/LMDE/LMDE.qed -net nic vmware -m 2048 

and got the following in return with the VM not launching

qemu-system-x86_64: -net nic: drive with bus=0, unit=0 (index=0) exists

Tried good ol Google to make heads or tails of this, with no luck. Anyone have any idea what this means and what I need to do to satisfy what QEMU needs to launch the VM?

 

Thanks,

 

Ian

Link to comment
Share on other sites

Not sure what changed but now when I try to launch the VM via the basic startup or any start up for that matter I get:

failed to initialize KVM: Device or resource busy 

Reading and research keeps bringing me back to the BIOS not being set for vitualization but I checked and it is?

Link to comment
Share on other sites

securitybreach

Not sure what changed but now when I try to launch the VM via the basic startup or any start up for that matter I get:

failed to initialize KVM: Device or resource busy 

Reading and research keeps bringing me back to the BIOS not being set for vitualization but I checked and it is?

 

Have you done a kernel update and not rebooted? The reason I ask is because a lot of times modules and other things will not work until you reboot after a kernel update.

Link to comment
Share on other sites

securitybreach

I think the problem is that you are trying to many options. You do not need 90% of the options from the wiki. This is what I just used to install LMDE:

 

First I made the image

qemu-img create -f qcow2 LMDE.qcow2 8G

 

To boot the iso:

qemu-system-x86_64 --enable-kvm -cdrom Downloads/linuxmint-201303-mate-dvd-64bit.iso -vga vmware -m 3000 -smp 2 -boot d LMDE.qcow2

 

After installing LMDE, I then started qemu with this

qemu-system-x86_64 -enable-kvm -vga vmware -m 3000 -smp 2 LMDE.qcow2

 

Its that easy.....

Edited by securitybreach
Missed a step
Link to comment
Share on other sites

Awesome, all of that worked. In reading the KVM wiki which I had read says that it guest OS should be an .iso file and not a burned image onto CD or DVD. When I launch LMDE in QEMU it's not trying to read from the CD Rom. Is there an additional command I need to add. I tried a few and was able to get it to boot from the .iso file on my hard drive but when it came up it was HUGE and I could not operate in it. I have both a burned image of LMDE on DVD and now I am writing the direct .iso file to DVD now in hopes that it will try to connect to it when launched.

Link to comment
Share on other sites

securitybreach

You do not need to burn anything.

 

Oop, I missed a step sorry:

First I made the image

qemu-img create -f qcow2 LMDE.qcow2 8G

 

To boot the iso:

qemu-system-x86_64 --enable-kvm -cdrom Downloads/linuxmint-201303-mate-dvd-64bit.iso -vga vmware -m 3000 -smp 2 -boot d LMDE.qcow2

 

After installing LMDE, then I started qemu with this

qemu-system-x86_64 -enable-kvm -vga vmware -m 3000 -smp 2 LMDE.qcow2

 

My bad ;)

Link to comment
Share on other sites

Cool, making progress. LMDE is in the process of installing on LMDE.qcow2. Though at this point the graphics are complete garbage, will see what happens once it's installed and running directly from LMDE.qcow2. :thumbsup:

 

Thanks Josh

Link to comment
Share on other sites

securitybreach

Cool, making progress. LMDE is in the process of installing on LMDE.qcow2. Though at this point the graphics are complete garbage, will see what happens once it's installed and running directly from LMDE.qcow2. :thumbsup:

 

Thanks Josh

 

Did you use the -vga vmware and if so, did you go into the control panel and change the resolution?

Link to comment
Share on other sites

securitybreach

Yes I used the -vga vmware flag but have not gone into resolution in LMDE and changed anything yet.

 

That would be why your graphics looks crappy.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...