Skip to content

Instantly share code, notes, and snippets.

@cleanerspam
cleanerspam / gist:0f1c37d501ea5b88b575c642251ff8f2
Created September 11, 2023 15:09
How to edit contents inside a Virtualbox windows.vdi and make a new vdi from the previous one ?
First of all vdi cant be directly modified in an easy way on Linux
Lets suppose we have all our virtualbox files inside Virtaulbox folder in home directory
VBoxManage clonehd ~/Virtualbox/windows11/windows11.vdi output.img --format RAW
Above command will make a clone of your current vdi , remeber the output.img will have the fuoll size the windows11.vdi was allocated
now we have got a clone of windows11.vdi , in form of output.img
sudo losetup -P /dev/loop0 output.img
Above command will mount the output.img as loop device on /dev/loop0
Now , open Dolphin file manager of KDE Plasma , on left sideview it will show an unmounted Partition mount it
Now you can see the contents of .vdi that was first changed to .img then it was mounted as loop device
Edit replace the files as needed