Good afternoon. I am sending this email because I had a problem while trying
to use your patch.
I was using libvirt version 0.8.5 before you send this patch. I upgraded it
to version 0.9.2, then I applied your patch.
I can see that libvirt properly communicated with VBox hypervisor and added
the shared folder but when I started it, my domain boots and initializes
until a certain point where, strangely, it restarts the VM again, and so
this process keeps repeating indefinitely. Maybe this is happening when the
domain tries to mount the shared folder.
I am using Ubuntu 10.04 and version 0.9.2 of libvirt. Before installing
version 9.04 I run command make uninstall and then downloaded 0.9.2's tar.gz
from the libvirt website. Once I wasn't sure if the problem was caused by
your patch, I tried to start a VM without libvirt (through VirtualBox OSE)
and it started using the same virtual disk with no problem. My libvirt
version went back to 0.9.0 and then, without patching, I tested it to see if
libvirt would start my domain properly, but the problem remained.
I repeated all the previous steps in another machine and this problem
happened there also, even after it went through the patching process.
With that in mind, we'd like to talk more with you about this shared folder
feature supported by Libvirt.
Me and my team are working on an open source project called Ourgrid, which
is a middleware for grid computing (
http://www.ourgrid.org/).
We use virtual machines for remote sandboxed execution. Currently we support
VBox and VServer hypervisors. However, we want it to have an uniform
handling. That's when we found out that Libvirt seemed to handle many
virtualization hypervisors, and then we thought using Libvirt could be a
good idea.
We know that some hypervisors don't provide an easy way to send remote
commands to be executed by the domain, so we think that the most general way
to handle with all of them is using a shared folder and having a deamon
running in the previously configured domain that monitors this shared folder
that executes the scripts staged in the folder.
But as far as we know, the shared folder feature is not fully developed yet
for all hypervisors supported by Libvirt.
We are not very experienced in C programming, neither in Libvirt code, so
we'd like to know if this feature (for all, or most of all hypervisors
provided by libvirt) is expected in the Libvirt development agenda or is it
something out of its scope.
If this is out of your development agenda, we are very keen to try
implementing it, once this is a major issue for us.
Obviously, any help/suggestion would be appreciated.
Thanks.
2011/6/7 Matthias Bolte <matthias.bolte(a)googlemail.com>
2011/6/7 Guilherme Santos <guisgb13(a)gmail.com>:
>> A shared folder will
>> probably just map to this XML snippet:
>>
>> <filesystem type='mount'>
>> <source dir='/home/guilhermesgb/Desktop/SharedFolder'/>
>>
>> <target dir='myshare1'/>
>>
>> </filesystem>
>
> I see. I also tried this XML configuration you gave as an example, but it
> wouldn't work. And now I know why...
>
>> <shareddir fstype="ext4"
path="/home/guilhermesgb/Desktop/SharedFolder"
>> mount_tag="SharingName" security_model="passthrough" />
>>
>> Where did you find this? This is not libvirt XML.
>
> I found it searching through Google:
>
http://www.mail-archive.com/libvir-list@redhat.com/msg27808.html -
altough I
> just used it as a last resort, as anything else would work.
Ah, that was just some idea that never got implemented.
> We have chosen to use libvirt in order to deal, in a generalized way,
with
> the
> process of starting virtual machines, stopping them, executing remote
> commands and creating shared folders.
> As we saw that libvirt cannot handle with executing remote commands
without
> any manual configuration by us (setting up consoles, through ssh, etc.),
we
> will basically use a shared folder to store scripts that are to be
executed
> by the guest, and the guest would have a running daemon that monitors
this
> shared folder and executes everything in it.
>
> Do you know how could I share a folder with a VBox guest through actual
> Libvirt code?
Oh, I missed to CC you on this patch:
https://www.redhat.com/archives/libvir-list/2011-June/msg00315.html
That makes libvirt support VirtualBox shared folders.
> We are also trying to do this through the Java binding, but it won't work
> either. As you said, it's not supported yet.
> We will eventually have to do this for all other hypervisors supported by
> Libvirt, so I'd like to know: which hypervisors have this shared folder
> funcionality supported by Libvirt?
The <filesystem> element is supported for Qemu and also for LXC and
OpenVZ judging by the codebase.
Matthias
> We are very thankful for your answers and willing to see new feature in
the
> next version!
>
> 2011/6/7 Matthias Bolte <matthias.bolte(a)googlemail.com>
>>
>> 2011/6/6 Guilherme Santos <guisgb13(a)gmail.com>:
>> > Well, I am still with that problem, attempting to create shared
folders,
>> > so
>> > I will try to be more specific and then maybe somebody can help me.
>>
>> Your problem is simple, libvirt currently doesn't support shared
>> folder for VirtualBox. I'll have a look at it and if it's simple to
>> implement you might see it in libvirt 0.9.3.
>>
>>
>>
>> > When I say "I am trying to set up shared folders", I mean that I
set
>> > this
>> > configuration in my XML description:
>> >
>> > <filesystem type='template' accessmode='mapped'>
>> > <source name='/home/guilhermesgb/Desktop/SharedFolder/>
>> > <target dir='/home/tarciso/Desktop/SharedFolder'/>
>> > </filesystem>
>>
>> VirtualBox shared folders don't support setting an access mode. The
>> target dir will map to the name of the shared folder in the guest.
>> Also the template type is OpenVZ specific. A shared folder will
>> probably just map to this XML snippet:
>>
>> <filesystem type='mount'>
>> <source dir='/home/guilhermesgb/Desktop/SharedFolder'/>
>> <target dir='myshare1'/>
>> </filesystem>
>>
>> You might also specify the <readonly/> option.
>>
>> > This was my last attempt. I also tried all other combinations, with
>> > accessmodes "passthrough" and "squash", for filesystem
type "mount"
too.
>> >
>> > I can't send you any error messages neither printscreens because my
>> > problem
>> > is that anything happens, the domain is started properly but no shared
>> > folder is specified so I can mount it, using command "sudo mount -t
>> > vboxsf
>> > SharedFolder /home/tarciso/Desktop/SharedFolder". I always get a
>> > protocol
>> > error.
>> >
>> > I was expecting libvirt to automatically do this step for me, so I
>> > wouldn't
>> > need to do it manually through vbox GUI or VBoxManage.
>>
>> As I said libvirt just doesn't support this yet, but I'll look at it.
>>
>> > During my searches through the web, I found this other option,
although
>> > I
>> > can't be sure if it is implemented, as the libvirt website says
nothing
>> > about it: defining an XML file with this configuration:
>> >
>> > <shareddir fstype="ext4"
>> > path="/home/guilhermesgb/Desktop/SharedFolder"
>> > mount_tag="SharingName" security_model="passthrough"
/>
>>
>> Where did you find this? This is not libvirt XML.
>>
>> > And then mounting it with proper command (the same as before, now with
>> > the
>> > mount_tag specified: "sudo mount -t vboxsf SharingName
>> > /home/tarciso/Desktop/SharedFolder" . Unfortunatelly the same error
>> > persists.
>> >
>> > Am I missing something?
>>
>> No, it is exactly as expected, but it'll improve.
>>
>> Matthias
>>
>> > Sorry if my first message was hard to understand. Thanks.
>> >
>> > 2011/6/1 Guilherme Santos <guisgb13(a)gmail.com>
>> >>
>> >> Good afternoon.
>> >>
>> >> I am having trouble trying to set up shared folders in the guest VM
>> >> using
>> >> VirtualBox hypervisor. No matter what configuration is defined in my
>> >> XML, it
>> >> never works, I mean, no shared folder is added/specifyed, then,
inside
>> >> the
>> >> guest, when I try to mount the folder, I always get a protocol error.
>> >>
>> >> If I use VirtualBoxManage, I can add/specify shared folders easily
and
>> >> mount it with no problem.
>> >>
>> >> I need to use libvirt in order to deal, in a generalized way, with
the
>> >> process of creating shared folders in all hypervisors supported by
>> >> libvirt,
>> >> otherwise my problem would be solved already. I must not use specific
>> >> commands of a certain hypervisor (such as VirtualBoxManage's).
>> >>
>> >> How does libvirt allow me to set up shared folders? Does it use
>> >> VirtualBoxManage for VBox hypervisors? If so, how do I use it?
>> >> I've read the documentation and followed it in defining my XMLs.
>> >>
>> >> Thanks anyway!
>> >> --
>> >> Guilherme Santos G. Baptista
>> >> Undergraduate in Computer Science at UFCG
>> >> LSD - Distributed Systems Laboratory
>> >
>> >
>> >
>> > --
>> > Guilherme Santos G. Baptista
>> > Graduando em Ciência da Computação pela UFCG
>> > LSD - Laboratório de Sistemas Distribuídos
>> >
>> > _______________________________________________
>> > libvirt-users mailing list
>> > libvirt-users(a)redhat.com
>> >
https://www.redhat.com/mailman/listinfo/libvirt-users
>> >
>
>
>
> --
> Guilherme Santos G. Baptista
> Graduando em Ciência da Computação pela UFCG
> LSD - Laboratório de Sistemas Distribuídos
>
--
Guilherme Santos G. Baptista
Graduando em Ciência da Computação pela UFCG
LSD - Laboratório de Sistemas Distribuídos