Using a Physical Hard Drive with VirtualBox VM on openSUSE Tumbleweed and Windows Dual-Boot Setup

Abstract: Resolve VirtualBox raw disk access permission errors on openSUSE by configuring persistent udev rules for physical drive partitions.

Created: 2026-08-28 by

Accessing a physical hard drive in VirtualBox on openSUSE Tumbleweed requires creating a VMDK wrapper file via the command line, as the GUI does not support direct device selection. This method allows your virtual machine to read and write directly to the disk partition while maintaining proper permissions through udev rules.

Understanding Raw Disk Access

VirtualBox provides a feature called "raw disk access" that lets a virtual machine interact with a physical block device rather than a virtual disk image. This is particularly useful for testing operating systems installed on separate partitions or for benchmarking storage performance without the overhead of file system emulation. However, this approach carries significant risks. If the virtual machine writes to the wrong sector, it can corrupt the host system or other guest OS installations. Therefore, strict isolation and correct permission handling are mandatory before starting any configuration. On openSUSE Tumbleweed, which uses systemd and udev, managing these permissions is more robust than simple manual chmod commands. The key challenge is that VirtualBox needs read-write access to the raw device node, typically located at /dev/sdXN, but standard user accounts do not have these privileges by default. Attempting to run VirtualBox as root is insecure and often fails due to sandbox restrictions. Instead, we will use a combination of a VMDK wrapper and a persistent udev rule.

Creating the VMDK Wrapper File

The first step is to create a small descriptor file that tells VirtualBox how to interpret the raw disk. You cannot select the raw disk directly from the VirtualBox Manager interface. You must use the VBoxManage utility available in your terminal. First, identify the target partition using lsblk. For example, if you want to attach the second partition of the first SATA drive, it might be /dev/sdb2. Run the following command to generate the wrapper:
VBoxManage internalcommands createrawvmdk \
    -filename /path/to/your/disk.vmdk \
    -rawdisk /dev/sdb2 \
    -partitions 2
This command creates a .vmdk file that acts as a pointer to the physical partition. Note the use of the -partitions flag; this ensures that only the specified partition is exposed to the VM, preventing accidental access to the entire disk structure which could cause boot failures or data corruption. Replace /path/to/your/disk.vmdk with an absolute path where you have write permissions, such as your home directory or a dedicated VMs folder. The -rawdisk parameter must point to the exact block device node.

Configuring Permissions with Udev Rules

Simply creating the VMDK file is not enough. When you add this file to your VM settings, VirtualBox will attempt to open the underlying /dev/sdb2 device. Without proper permissions, this operation will fail with an I/O error. On openSUSE, relying on temporary ownership changes is fragile because they reset after reboots or device replugging. A permanent solution involves creating a udev rule. Create a new file in /etc/udev/rules.d/, for example, 99-virtualbox-rawdisk.rules. Add a line that matches your specific device and grants access to the group running VirtualBox, typically vboxusers.
SUBSYSTEM=="block", KERNEL=="sdb2", GROUP="vboxusers", MODE="0660"
After saving this file, reload the udev rules using:
sudo udevadm control --reload-rules
sudo udevadm trigger
This ensures that every time the kernel detects /dev/sdb2, it automatically assigns the correct group and permissions. Verify the change by checking the properties of the device node with ls -l /dev/sdb2; the group should now show as vboxusers and the mode as rw-r-----.

Attaching the Disk to Your VM

Now that the wrapper and permissions are set, you can configure the virtual machine. Open the VirtualBox Manager, select your VM, and go to Settings > Storage. Under the Storage Tree, click the empty optical drive icon or add a new controller if necessary. Click the disk icon next to "Controller: IDE" (or SATA) and choose "Add Hard Disk." Browse to the .vmdk file you created earlier. Select the wrapper file. VirtualBox will recognize it as a linked raw disk. Ensure the controller type matches your VM's architecture. For modern setups, SATA is preferred over IDE for performance. Once added, start the VM. If configured correctly, the guest operating system will see the physical partition as a local disk. For networking considerations, if your VM also requires internet access, refer to our guide on VirtualBox Guest with NAT and DHCP for Windows Networking to ensure network connectivity does not interfere with disk operations.

Safety and Troubleshooting

Always double-check the device path before attaching. Attaching /dev/sda instead of /dev/sda1 can overwrite partition tables. If the VM fails to boot or reports disk errors, check the VirtualBox log file for I/O errors. These usually indicate a permission mismatch or an incorrect device path. If you need to manage snapshots for this setup, note that raw disks do not support traditional snapshotting in the same way VDI files do. You may need to rely on external backup strategies. For managing standard virtual disks, see our article on Shrinking a Snapshot of a VDI in VirtualBox for best practices on disk maintenance.

Frequently Asked Questions

Can I use the VirtualBox GUI to select a raw disk?

No, the graphical interface does not allow direct selection of Linux block devices like /dev/sdX. You must create a VMDK wrapper file using the VBoxManage command-line tool and then attach that wrapper file through the GUI.

What happens if I lose power during a raw disk write?

Raw disk access bypasses the file system cache of the host OS. Sudden power loss can lead to data corruption in both the host and the guest file systems. It is highly recommended to use a UPS or ensure stable power conditions when performing heavy I/O operations on raw disks.

How do I detach the raw disk safely?

You do not need to unmount anything inside the guest. Simply shut down the VM normally. Then, remove the disk from the VM settings in VirtualBox. To revoke permissions, you can either remove the udev rule or change the group back to disk or root depending on your security policy.

Does this work with LUKS encrypted drives?

Yes, but the encryption must be unlocked on the host before VirtualBox can access the raw device. VirtualBox sees the decrypted block device. If the drive is encrypted on the guest side, the VM will handle decryption independently, provided the host has access to the raw block device.

Why does my VM report "I/O Error" even with correct permissions?

This often occurs if the device is mounted by the host OS. VirtualBox requires exclusive access to the raw block device. Ensure that no partitions from the target disk are mounted in openSUSE Tumbleweed before starting the VM. Use umount /dev/sdXN if necessary.

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