qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Using the one disk image file on 2 virtual machines at the


From: Manjong Han
Subject: [Qemu-devel] Using the one disk image file on 2 virtual machines at the same time
Date: Wed, 29 Jul 2015 00:57:30 +0900

Hi,

I was 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 same command.
$ qemu-system-x86_64 -smp 2 -m 1024 -hda 10G.qcow2 -enable-kvm

Then, I had 2 virtual machines, using same disk image file.

When I made a directory on first virtual machine, using the command like below.
$ mkdir test1

The "test1" directory wasn't showed 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 another virtual machine, too.

Then, I shut the all virtual machines down. I tried to mount the disk image file on my host machine.
$ sudo modprobe nbd
$ sudo qemu-nbd -c /dev/nbd0
$ sudo mount /dev/nbd0p1 /mnt/10G

Then, I checked what the file is showed. The result was that "test2" directory only lived.

Where is the "test1" directory? This is the weird behavior on my test.

Before my test, I created a disk image file and installed the OS on the disk image, using the commands like below.
$ qemu-img create -f qcow2 -o preallocation=metadata 10G.qcow2 10G
$ qemu-system-x86_64 -smp 2 -m 2048 -hda 10G.qcow2 -cdrom ../iso/ubuntu-1404.2-desktop-x86_64.iso -enable-kvm

reply via email to

[Prev in Thread] Current Thread [Next in Thread]