Any use WebVirtMgr with KVM ??


Recommended Posts

I have a symlink , and above command what that I used.  I do compile it on a slack VM

With the new libvirt package in the pluggin, it turns on sasl2 for tcp connections to libvirt. I can't figure out how to turn it off.  So you need a username/password to connect to libvirt. Without sasl2 you could use any unRAID username/password. That command creates it and stores it in/etc/libvirt/passwd.db. This will show you the users in that db.

sasldblistusers2 -f /etc/libvirt/passwd.db

 

I tried changing settings in /etc/libvirt/libvirtd.conf but couldn't turn it off.  I might look at commenting out /etc/sasl2/libvirt.conf

 

Did you change this setting in libvirtd.conf:

auth_tcp = "none"

Link to comment
  • Replies 120
  • Created
  • Last Reply

Top Posters In This Topic

Yes I tried the other authentication method (not sasl) to try and turn it off.  But right now it's a default config with only tcp listen uncommented and the line is set to none by default.  I don't really mind it as it adds some security.  Just if you don't need it it's not necessary. I haven't tried commenting out lines in /etc/sasl2/libvirt.conf yet.  I did try deleting it with no effect.

 

I also tried creating a libvirt group and adding a user to that group and adding the appropriate settings in libvirtd.conf

 

Link to comment

 

virt-manager under my Ubuntu-VM works great for Unraid KVM!

 

//Peter

 

Oh that's awesome! I'm assuming you are using Ubuntu with a VNC viewer? If that is the cause I may have to consider deleting my Ubuntu server and changing to Ubuntu desktop. Virt-mama gee is a great tool!

 

Maybe this is useful for you ;-)

http://www.htpcbeginner.com/install-gui-on-ubuntu-server-14-04-gnome/

Link to comment

 

virt-manager under my Ubuntu-VM works great for Unraid KVM!

 

//Peter

 

Oh that's awesome! I'm assuming you are using Ubuntu with a VNC viewer? If that is the cause I may have to consider deleting my Ubuntu server and changing to Ubuntu desktop. Virt-mama gee is a great tool!

You could just create a small desktop only one or apt-get something lite like xfce desktop in your current ubuntu vm

 

Edit:

Or what he said

Link to comment

Oh that's a great idea! So if I remember correctly I just have to uncomment a line in libvirt and I should be able to connect?

Yep but with the version of libvirt in 6b7 you won't be able to create virtual networks or see network interfaces.  But you can just install the libvirt package from the plugin and then saslpasswd2 command then restart libvirt.

Link to comment

Will doing any of this mess up future releases of unRAID? I know it's a difficult question but it would be a pain to have to redo everything later on.

No all your vm's and unraid would be fine.  You wouldn't want to use it on a new version cause it might be fixed but if it's not and they use the same version it should be fine.  That's the nice thing about unraid being in ram,  you mess it up, you can just remove what you did and reboot.  And the nice thing about vm's too. I always back them up to the array. If I mess them up I can just reload a backup.

Link to comment

I just submitted a patch to WebVirtMgr which should make setup significantly easier.

 

https://github.com/rmk40/webvirtmgr

https://github.com/rmk40/webvirtmgr/commit/65973c914455e82627f8e96176ae4da7dcf19ca1

 

It'll allow for using a local socket to connect to Libvirt and will eliminate the need to specify a hostname or login credentials.  The patch is pending a pull request so hopefully it'll be upstream soon but this plugin is welcome to pull directly from my repo in the meantime.

Link to comment

I just submitted a patch to WebVirtMgr which should make setup significantly easier.

 

https://github.com/rmk40/webvirtmgr

https://github.com/rmk40/webvirtmgr/commit/65973c914455e82627f8e96176ae4da7dcf19ca1

 

It'll allow for using a local socket to connect to Libvirt and will eliminate the need to specify a hostname or login credentials.  The patch is pending a pull request so hopefully it'll be upstream soon but this plugin is welcome to pull directly from my repo in the meantime.

Thanks,  I'll try it out. I saw your post I think in one of the bug reports.  Do you think this would help with vnc console connection at least and maybe not seeing network interfaces during instance or vm creation?

 

I thought about seeing if he would include a daemon and pid option since Slackware doesn't have a start-stop-daemon.

Link to comment

So I have virt-manager connected. It shows that my ubuntu server vm is active which is cool. I have an SSD mounted to my unRAID server that stores my VM's. virt-manager only appears to store vm's in "var/lib/libvirt/images". Do I have to mount my vm share to my ubuntu server and then point the virt-manager settings to the vm share?

Link to comment

 

 

So I have virt-manager connected. It shows that my ubuntu server vm is active which is cool. I have an SSD mounted to my unRAID server that stores my VM's. virt-manager only appears to store vm's in "var/lib/libvirt/images". Do I have to mount my vm share to my ubuntu server and then point the virt-manager settings to the vm share?

 

No. Just set up storage locations in virt-manager.  They should coincide with their location in unraid. I run virt-manager on my laptop,  nothing from unraid is mounted. I have a vm storage for domain inage files and a media storage for iso images all are located on my non-array mounted ssd. This is where I also point libvirt symlink to also.

Link to comment

hmm I might not have libvirt symlink properly. I used your scripts (S00 & K00) which seem to work great. I was just trying to create a VM with virt-manager and it was only letting me make an 8 GB image (the same size as my flash drive). Am I missing a step or should I be manually creating the images on my cache drive and then virt-manager will see them?

Link to comment

I just submitted a patch to WebVirtMgr which should make setup significantly easier.

 

https://github.com/rmk40/webvirtmgr

https://github.com/rmk40/webvirtmgr/commit/65973c914455e82627f8e96176ae4da7dcf19ca1

 

It'll allow for using a local socket to connect to Libvirt and will eliminate the need to specify a hostname or login credentials.  The patch is pending a pull request so hopefully it'll be upstream soon but this plugin is welcome to pull directly from my repo in the meantime.

Thanks again this works perfectly I updated the plugin to use your repository till he accepts it. I am able to connect to the local socket.  Still need to figure out vnc console and network connecitons.

Link to comment

Thanks again this works perfectly I updated the plugin to use your repository till he accepts it. I am able to connect to the local socket.  Still need to figure out vnc console and network connecitons.

 

No problem. I'll help get vnc going tomorrow. It's the same approach as what is used with OpenStack Nova, so it shouldn't be too difficult.

 

Link to comment

In the S script it should be LVDIR=/mnt/cache/libvirt.  In virt-manager under "Edit" then "Connection Details" then "Storage" tab I have a storage pool:

Name: default

Type: dir: Filesystem Directory

Target Path: /mnt/domains/images (vm_images for you)

 

You're awesome! Using your plugin I have downgraded libvirt back to 1.2.6 which lets me see the virtual networks. When I create a vm with virt-manager and click start I get "Error: viewer connection to hypervisor host got refused or disconnected!" Any thoughts on why I cannot view the vm?

Link to comment

In the S script it should be LVDIR=/mnt/cache/libvirt.  In virt-manager under "Edit" then "Connection Details" then "Storage" tab I have a storage pool:

Name: default

Type: dir: Filesystem Directory

Target Path: /mnt/domains/images (vm_images for you)

 

You're awesome! Using your plugin I have downgraded libvirt back to 1.2.6 which lets me see the virtual networks. When I create a vm with virt-manager and click start I get "Error: viewer connection to hypervisor host got refused or disconnected!" Any thoughts on why I cannot view the vm?

Did you setup a vnc connection when creating the vm? You can stop the vm then add it through virt-manager add hardware under graphics I think.

 

 

Link to comment

To get VNC going, make sure you have a VNC graphics device with websockets enabled, like so:

 

    <graphics type='vnc' port='-1' autoport='yes' websocket='-1' listen='0.0.0.0' passwd='somethingcomplexrandom'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>

 

The reason -1 is used for ports is to let libvirt figure out a port and dynamically assign one.  If you prefer, you can statically assign unique ports of your choosing.  You will not need to know the ports or the password (use something complex/random) when using WebVirtMgr.  The password is important (not that it represents real security) because there's no actual proxy being used here, so VNC ports will be exposed to the entire network.

 

To be clear, you do not need websockify at all when using the aforementioned approach.  Websockify exists to convert a TCP socket into a web socket.  QEMU has supported directly exposing VNC as a websocket for some time now, which is all we're enabling here.

Link to comment

 

 

Yes, virt-manager has a VNC connection added. My only thoughts are maybe I have to edit/uncomment more things out of libvirtd.conf? I shouldn't have to install a VNC viewer on my ubuntu vm correct?

 

The only thing you should have uncommented in libvirt.conf is tcp listen. You created a sasl2passwd user and password so virt-manager asks for a username and password to view unraid vm's? Virt-manager has a built in vnc viewer. What ip address and port are in your vm xml file.

Link to comment

To get VNC going, make sure you have a VNC graphics device with websockets enabled, like so:

 

    <graphics type='vnc' port='-1' autoport='yes' websocket='-1' listen='0.0.0.0' passwd='somethingcomplexrandom'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>

 

The reason -1 is used for ports is to let libvirt figure out a port and dynamically assign one.  If you prefer, you can statically assign unique ports of your choosing.  You will not need to know the ports or the password (use something complex/random) when using WebVirtMgr.  The password is important (not that it represents real security) because there's no actual proxy being used here, so VNC ports will be exposed to the entire network.

 

To be clear, you do not need websockify at all when using the aforementioned approach.  Websockify exists to convert a TCP socket into a web socket.  QEMU has supported directly exposing VNC as a websocket for some time now, which is all we're enabling here.

 

Thanks no more 1006 error but it times out. I'm not home so I'm probably not forwarding the right ports.  Do I need to do anything in the vm differently?

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.