From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56939) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKCbu-0002xT-Ip for qemu-devel@nongnu.org; Tue, 28 Jul 2015 17:40:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZKCbp-0007Fj-J4 for qemu-devel@nongnu.org; Tue, 28 Jul 2015 17:40:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52760) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZKCbp-0007FI-E5 for qemu-devel@nongnu.org; Tue, 28 Jul 2015 17:40:25 -0400 References: <4A7D0474-7DAE-47F3-8ABA-8EE21036BA20@gmail.com> From: Eric Blake Message-ID: <55B7F6C7.501@redhat.com> Date: Tue, 28 Jul 2015 15:40:23 -0600 MIME-Version: 1.0 In-Reply-To: <4A7D0474-7DAE-47F3-8ABA-8EE21036BA20@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="0tMGfBAIwrwTfRQ998gHNKa5iWp312xaI" Subject: Re: [Qemu-devel] Using the one disk image file on 2 virtual machines at the same time List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?7ZWc66eM7KKF?= , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --0tMGfBAIwrwTfRQ998gHNKa5iWp312xaI Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/28/2015 11:06 AM, =ED=95=9C=EB=A7=8C=EC=A2=85 wrote: > Hi, >=20 > I'm facing a weird behavior when I used the one disk image file on 2 vi= rtual machines at the same time. >=20 > 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 >=20 > When the OS(Ubuntu 14.04 64bit) was booted up, I made an another one, u= sing the same command. > $ qemu-system-x86_64 -smp 2 -m 1024 -hda 10G.qcow2 -enable-kvm >=20 > 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. >=20 > When I made a directory on first virtual machine, using the command lik= e below. > $ mkdir test1 >=20 > 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 >=20 > 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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --0tMGfBAIwrwTfRQ998gHNKa5iWp312xaI Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJVt/bIAAoJEKeha0olJ0NqLtAH/j4k3MlNenlspr7pOrKcy9K5 VM1+WZ1Y9FmQntJ9zDtij64NyvANm8G+oTIUbClfBcfJRhvnwrk41jxdwCig9p50 dxBn1Axhke8epEVAwVmOxaAFHydridJckdKm4ti1F+4St1cvwhW0VAherkFxd+S+ RHotqhIatfvD1g9FpgOcMA1esCGXDw3VdJhGrKjrb0wbOKPWZ9Ywx9dTQgF14Loh ybNrCtupsYAB1stS7yL1sQ9MJWJiw/pox9JNGeLGmpnToRUnPL3vDSml0WXH7mYF OW7CZxco6pUDuTFa+rR2djtKekZR808Ai6daJ22ZoGeWEBlWQX20vsjH34BuJzM= =uff5 -----END PGP SIGNATURE----- --0tMGfBAIwrwTfRQ998gHNKa5iWp312xaI--