Skip to content

Instantly share code, notes, and snippets.

@nijave
Created October 12, 2023 17:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nijave/b12259e085e9836604cd379658f6047b to your computer and use it in GitHub Desktop.
Save nijave/b12259e085e9836604cd379658f6047b to your computer and use it in GitHub Desktop.
sudo dnf install -y VirtualBox-server
# Make a vhd
qemu-img create -f vpc test.vhd 8G
virt-format -a test.vhd --partition=gpt --filesystem=ntfs
echo 'write /readme.txt "readme"' | guestfish -a test.vhd -m /dev/sda1
mkdir test
vboximg-mount --image $(pwd)/test.vhd --rw --root test
mkdir testfs
sudo mount -t ntfs test/vol0 testfs
touch testfs/new-file
sudo umount testfs
umount test
echo 'ls /' | guestfish -a test.vhd -m /dev/sda1
# new-file
# readme.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment