On 07/28/2015 11:06 AM, 한만종 wrote: > Hi, > > I'm facing a weird behavior when I used the one disk image file on 2 virtual > machines at the same time. > > I made the instance of a virtual machine, using the below command. > $ qemu-system-x86_64 -smp 2 -m 1024 -hda 10G.qcow2 -enable-kvm > > When the OS(Ubuntu 14.04 64bit) was booted up, I made an another one, using > the same command. > $ qemu-system-x86_64 -smp 2 -m 1024 -hda 10G.qcow2 -enable-kvm > > Then, I had 2 virtual machines using the same disk image file.
Bad idea. You should NEVER have more than one qemu or qemu-img opening an image read-write at the same time (even having multiple read-only qemu-img visitors visiting a file opened read-write by qemu is dangerous). You are very likely to cause fatal corruption to the point that neither guest will be able to see data. > > When I made a directory on first virtual machine, using the command like > below. > $ mkdir test1 > > The "test1" directory wasn't showed on another virtual machine. And, I made a > directory on second virtual machine, using the command like below. > $ mkdir test2 > > The "test2" directory wasn't showed on another virtual machine, either. And you should NOT expect it to work. qcow2 images are NOT shared file systems. If you want a shared file system, then do something like having both your guests mount common storage via NFS or glusterfs or some other protocol designed to be used as a shared file systems. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature