From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f17Kx-0003B0-6S for qemu-devel@nongnu.org; Wed, 28 Mar 2018 05:25:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f17Kt-0003vX-2N for qemu-devel@nongnu.org; Wed, 28 Mar 2018 05:25:43 -0400 Received: from indium.canonical.com ([91.189.90.7]:43052) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f17Ks-0003uA-SQ for qemu-devel@nongnu.org; Wed, 28 Mar 2018 05:25:39 -0400 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.86_2 #2 (Debian)) id 1f17Kr-0004O0-NP for ; Wed, 28 Mar 2018 09:25:37 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id ACC1D2E8007 for ; Wed, 28 Mar 2018 09:25:37 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Wed, 28 Mar 2018 09:12:40 -0000 From: Zixuan Wang <1759522@bugs.launchpad.net> Reply-To: Bug 1759522 <1759522@bugs.launchpad.net> Sender: bounces@canonical.com Message-Id: <152222836105.21062.2375148895134658603.malonedeb@chaenomeles.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 1759522] [NEW] windows qemu-img create vpc/vhdx error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Public bug reported: On windows, using qemu-img (version 2.11.90) to create vpc/vhdx virtual disk tends to fail. Here's the way to reproduce: 1. Install qemu-w64-setup-20180321.exe 2. Use `qemu-img create -f vhdx -o subformat=3Dfixed disk.vhdx 512M` to cre= ate a vhdx: Formatting 'disk.vhdx', fmt=3Dvhdx size=3D536870912 log_size=3D1048576 b= lock_size=3D0 subformat=3Dfixed 3. Execute `qemu-img info disk.vhdx` gives the result, (note the `disk size= ` is incorrect): image: disk.vhdx file format: vhdx virtual size: 512M (536870912 bytes) disk size: 1.4M cluster_size: 8388608 4. On Windows 10 (V1709), double click disk.vhdx gives an error: Make sure the file is in an NTFS volume and isn't in a compressed folder= or volume. Using Disk Management -> Action -> Attach VHD gives an error: The requested operation could not be completed due to a virtual disk sys= tem limitation. Virtual hard disk files must be uncompressed and uneccrypte= d and must not be sparse. Comparison with Windows 10 created VHDX: 1. Using Disk Management -> Action -> Create VHD: File name: win.vhdx Virtual hard disk size: 512MB Virtual hard disk format: VHDX Virtual hard disk type: Fixed size 2. Detach VHDX 3. Execute `qemu-img info win.vhdx` gives the result: image: win.vhdx file format: vhdx virtual size: 512M (536870912 bytes) disk size: 516M cluster_size: 33554432 Comparison with qemu-img under Ubuntu: 1. Version: qemu-img version 2.5.0 (Debian 1:2.5+dfsg-5ubuntu10.16), Copyright (c) 2004-2008 Fabrice Bellard 2. qemu-img create -f vhdx -o subformat=3Dfixed lin.vhdx 512M Formatting 'lin.vhdx', fmt=3Dvhdx size=3D536870912 log_size=3D1048576 bl= ock_size=3D0 subformat=3Dfixed 3. qemu-img info lin.vhdx image: lin.vhdx file format: vhdx virtual size: 512M (536870912 bytes) disk size: 520M cluster_size: 8388608 4. Load lin.vhdx under Windows 10 is ok The same thing happens on `vpc` format with or without `oformat=3Dfixed`, it seems that windows version of qemu-img has some incorrect operation? My guess is that windows version of qemu-img doesn't handle the description field of vpc/vhdx, which leads to an incorrect `disk size` field. ** Affects: qemu Importance: Undecided Status: New -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1759522 Title: windows qemu-img create vpc/vhdx error Status in QEMU: New Bug description: On windows, using qemu-img (version 2.11.90) to create vpc/vhdx virtual disk tends to fail. Here's the way to reproduce: 1. Install qemu-w64-setup-20180321.exe 2. Use `qemu-img create -f vhdx -o subformat=3Dfixed disk.vhdx 512M` to c= reate a vhdx: Formatting 'disk.vhdx', fmt=3Dvhdx size=3D536870912 log_size=3D1048576= block_size=3D0 subformat=3Dfixed 3. Execute `qemu-img info disk.vhdx` gives the result, (note the `disk si= ze` is incorrect): image: disk.vhdx file format: vhdx virtual size: 512M (536870912 bytes) disk size: 1.4M cluster_size: 8388608 4. On Windows 10 (V1709), double click disk.vhdx gives an error: Make sure the file is in an NTFS volume and isn't in a compressed fold= er or volume. Using Disk Management -> Action -> Attach VHD gives an error: The requested operation could not be completed due to a virtual disk s= ystem limitation. Virtual hard disk files must be uncompressed and uneccryp= ted and must not be sparse. Comparison with Windows 10 created VHDX: 1. Using Disk Management -> Action -> Create VHD: File name: win.vhdx Virtual hard disk size: 512MB Virtual hard disk format: VHDX Virtual hard disk type: Fixed size 2. Detach VHDX 3. Execute `qemu-img info win.vhdx` gives the result: image: win.vhdx file format: vhdx virtual size: 512M (536870912 bytes) disk size: 516M cluster_size: 33554432 Comparison with qemu-img under Ubuntu: 1. Version: qemu-img version 2.5.0 (Debian 1:2.5+dfsg-5ubuntu10.16), Copyright (c) 2004-2008 Fabrice Bellard 2. qemu-img create -f vhdx -o subformat=3Dfixed lin.vhdx 512M Formatting 'lin.vhdx', fmt=3Dvhdx size=3D536870912 log_size=3D1048576 = block_size=3D0 subformat=3Dfixed 3. qemu-img info lin.vhdx image: lin.vhdx file format: vhdx virtual size: 512M (536870912 bytes) disk size: 520M cluster_size: 8388608 4. Load lin.vhdx under Windows 10 is ok The same thing happens on `vpc` format with or without `oformat=3Dfixed`, it seems that windows version of qemu-img has some incorrect operation? My guess is that windows version of qemu-img doesn't handle the description field of vpc/vhdx, which leads to an incorrect `disk size` field. To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1759522/+subscriptions