Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
kvm and cdrom/dvd media detection/change [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
vaxbrat
l33t
l33t


Joined: 05 Oct 2005
Posts: 731
Location: DC Burbs

PostPosted: Fri Mar 27, 2009 5:06 am    Post subject: kvm and cdrom/dvd media detection/change [solved] Reply with quote

Does anyone have a good write up on how kvm can handle removeable media such as cdrom and dvd? I notice that the -cdrom option on startup requires either an iso or media be present when starting the guest. Also how can kvm get the guest to sense an eject/insert event when a cdrom or dvd is swapped out during a software installation?

Last edited by vaxbrat on Mon Apr 13, 2009 11:50 pm; edited 1 time in total
Back to top
View user's profile Send private message
bbgermany
Veteran
Veteran


Joined: 21 Feb 2005
Posts: 1844
Location: Oranienburg/Germany

PostPosted: Fri Mar 27, 2009 7:18 am    Post subject: Reply with quote

check out libvirt and virt-manager. this can swap cd-images or drives while running the vm.

bb
_________________
Desktop: Ryzen 5 5600G, 32GB, 2TB, RX7600
Notebook: Dell XPS 13 9370, 16GB, 1TB
Server #1: Ryzen 5 Pro 4650G, 64GB, 16.5TB
Server #2: Ryzen 4800H, 32GB, 22TB
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23091

PostPosted: Sat Mar 28, 2009 3:22 am    Post subject: Reply with quote

You can use the -drive option to attach an empty CD drive at start, then insert an ISO via the monitor later. KVM seems to create this CD drive by default, but you may want to use -drive if you want the CD to appear on a different interface. The monitor is also able to eject the mounted ISO from the virtual CD drive.
Back to top
View user's profile Send private message
vaxbrat
l33t
l33t


Joined: 05 Oct 2005
Posts: 731
Location: DC Burbs

PostPosted: Sun Apr 05, 2009 12:22 am    Post subject: virt-manager with kvm? Reply with quote

So, I finally got some time to play with this again and built virt-manager and related. I see libvirt uses the kvm USE flag but virt-manager doesn't. It also didn't give me the option to use anything other than qemu for the hypervisor. I briefly tried to use xen, but had some troubles building xen and xen-tools so I can understand why I didn't see that.

I also notice that virt-manager thoughtfully decided to set up iptables for me to masquerade for the guests. That's okay at first blush, but I did have a direct bridge working without masq by just adding a host route record for the guest. I wanted to go that way since my guest at work would need to be a dhcp client, and I would also want to be able to have inbound connections work since it would get updated via the corporate "spyware" (Altiris). Under this scheme I would have to play games with with both dnat/snat and it looks like virt-manager is only doing the outbound masquerading.

Hu: Which monitor are you talking about here? The virt-manager or some kvm thing?
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23091

PostPosted: Sun Apr 05, 2009 4:50 am    Post subject: Reply with quote

I was referring to the KVM monitor. Assuming you did not redirect it with the -monitor command line option, it should show up on virtual console 2. Switch virtual consoles by holding down the grab key sequence and pressing a number. Virtual console 1 defaults to showing the guest's video output.
Back to top
View user's profile Send private message
vaxbrat
l33t
l33t


Joined: 05 Oct 2005
Posts: 731
Location: DC Burbs

PostPosted: Sun Apr 05, 2009 6:01 pm    Post subject: monitor console Reply with quote

Ahh. I think I see what happened here. You are using the vnc setup while I'm just using sdl when playing with the kvm directly on the comand line.

Also I see that the virt-manager 0.6.0 ebuild DOES NOT include kvm support. When I pulled the latest source from the homepage (0.7.0), kvm had been added. I need to do some more checking of protections on this new version (installed to /usr/local) since the new vm wizard has all buttons greyed out and won't let me get past the first of 5 panels.
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 23091

PostPosted: Sun Apr 05, 2009 9:18 pm    Post subject: Reply with quote

The SDL presentation also allows access to the monitor. Start kvm with a basic command line, such as kvm -hda mydisk.img -snapshot. When the window appears, press Ctrl+Alt+2. You will get the monitor pane that I described. Press ctrl+alt+1 to return to the guest video card.

The monitor can be moved elsewhere via the -monitor command line option. Some front ends may do this so that they have more precise control over it. See the kvm documentation, section 3.3, subsection "Debug/Expert options" for the full list of places that the monitor can be sent.
Back to top
View user's profile Send private message
vaxbrat
l33t
l33t


Joined: 05 Oct 2005
Posts: 731
Location: DC Burbs

PostPosted: Fri Apr 10, 2009 4:14 am    Post subject: aha Reply with quote

I see that now. I read that too quickly and thought that you were referencing the standard virtual consoles on ctrl-alt-f1 etc instead of the numeric 1 etc.

One gripe I have now is kvm tends to hold onto my cursor on shutdown if the windows guest decides to not behave and actually shutdown or finally reset. For some reason the winders corporate loadsets I've been playing with sometimes get into a state where they don't want to finally end it all on a shutdown. It's annoying since I then have to bop over to another box on the kvm switch, ssh in and kill -9 the kvm instance to get my cursor back.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum