VM QEMU not recognizing virtual size: 'nospace left on device''

Abstract: Resolve QEMU no space left on device errors by checking host disk usage, expanding virtual disk images with qemu-img resize, and fixing permissions.

Created: 2026-08-27 by

The "No space left on device" error in QEMU typically occurs when the host filesystem lacks free blocks, the virtual disk image has reached its maximum allocated size, or permissions prevent writing to the storage path. Resolving this requires verifying host disk usage, expanding the virtual disk capacity using qemu-img, and ensuring correct file ownership for the QEMU process.

Understanding the Error Context

When QEMU reports that there is no space left on the device, it is usually a direct reflection of the underlying storage subsystem's state rather than a bug within the hypervisor itself. This error can manifest during VM creation, snapshot operations, or normal runtime writes if the backing store is full. It is critical to distinguish between a host-level storage exhaustion and a guest-level file system limit, although the former is the most common cause in virtualization environments.

Before attempting complex fixes, you must confirm that the error originates from the host operating system's inability to write data to the disk where the virtual machine files are stored. If the host has ample free space, the issue may lie with specific quotas, inode exhaustion, or permission errors that mimic a full disk condition. Understanding this distinction prevents unnecessary troubleshooting steps that do not address the root cause.

Check virt-manager with QEMU and KVM provides additional context on managing storage backends effectively, which can help in diagnosing similar issues when using higher-level management tools.

Verifying Host Disk Space and Inodes

The first diagnostic step is to check the available space on the host partition hosting your virtual disk images. Use the df -h command to view human-readable disk usage statistics. Look specifically at the Use% column for the mount point containing your .qcow2 or .raw files. If the percentage is 100%, you must free up space by removing unnecessary files or expanding the logical volume.

Additionally, check for inode exhaustion using the df -i command. Inode limits are often overlooked but can trigger "No space left on device" errors even when megabytes of free space remain. This situation commonly arises in directories with millions of small files. If inodes are exhausted, you cannot create new files regardless of available block space.

df -h /path/to/vm/storage
df -i /path/to/vm/storage

If you find that the host disk is indeed full, identify large files using the du -sh command on subdirectories. Cleaning up old snapshots, logs, or unused disk images will restore write capabilities to the QEMU instance.

Expanding Virtual Disk Images

Even if the host has space, the virtual disk image itself might have reached its configured maximum size. QEMU disk images, particularly those in qcow2 format, can be dynamically allocated but still have a virtual size limit defined at creation. You can expand this limit using the qemu-img resize command.

To increase the size of a virtual disk by 10 gigabytes, run the following command:

qemu-img resize /path/to/disk.img +10G

This command modifies the metadata of the image file to allow for more data allocation. However, resizing the container does not automatically extend the file system inside the guest OS. After resizing the image, you must boot the guest and use tools like fdisk, parted, or lvextend to utilize the new unallocated space within the guest's partition table.

If you are running QEMU in a nested virtualization environment, such as Ubuntu via VMware, ensure that the outer virtualization layer also has sufficient storage overhead. Refer to Run QEMU in virtualized UBUNTU via VMWARE for insights into managing storage layers in complex setups.

Checking Permissions and Ownership

Permission errors can sometimes masquerade as disk space errors. If the user running the QEMU process does not have write access to the directory or the image file, the kernel may return an I/O error that appears similar to a full disk. Verify ownership using ls -l on the storage directory.

ls -l /path/to/vm/storage/

Ensure that the current user or the libvirt/qemu group has read-write permissions. If necessary, change ownership using chown or adjust permissions with chmod. Incorrect SELinux contexts on Linux systems can also block write access, so check audit logs with ausearch -m avc if standard permissions appear correct.

Managing Snapshots and Backing Files

Snapshots can consume significant disk space over time, especially if they are not merged regularly. Each snapshot delta adds to the total storage footprint. Use qemu-img info to inspect the chain of backing files and snapshot sizes. If a snapshot chain is bloated, consider merging it to reclaim space and improve performance.

Regular maintenance of virtual disk images helps prevent sudden space exhaustion. Tools like qemu-img check can verify integrity, while qemu-img convert can optimize storage formats. For users dealing with corrupted data due to sudden power loss or space issues, understanding recovery methods is crucial.

How to Recover Corrupted btrfs Data from a VDI File in Linux outlines procedures for handling data integrity issues that may arise when storage limits are breached unexpectedly.

Frequently Asked Questions

Why does QEMU say no space left when df shows free space?

This discrepancy usually indicates inode exhaustion rather than block space shortage. Check inode usage with df -i to see if the file system has run out of directory entry slots. Additionally, verify that you are checking the correct mount point where the VM files reside.

Can I shrink a qcow2 virtual disk to save space?

Yes, you can reduce the virtual size of a qcow2 image using qemu-img resize with a negative value, but only after ensuring the guest file system does not need the extra space. Shrinking too aggressively can corrupt the guest OS if partitions are expanded beyond the original boundaries.

Does the guest OS file system fill up affect the host?

No, the guest OS filling its own internal drive does not impact the host's physical disk space directly, as dynamic images grow incrementally. However, if the guest writes heavily, the host disk will eventually fill up as the image file expands to accommodate the guest's data.

How do I fix permission denied errors that look like no space?

Ensure the QEMU process user owns the disk image and directory. Use chown to transfer ownership to the current user or libvirt service account. On SELinux-enabled systems, reset security contexts with restorecon if permissions are correct but access is still blocked.

What causes rapid disk growth in QEMU snapshots?

Every write operation inside the guest creates a delta in the active snapshot file. If snapshots are taken frequently without merging, the delta files grow continuously. Regularly merge snapshots using qemu-img commit to consolidate changes and stop the growth.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More