Merge pull request #81 from tetrahedras/mount-vm-image

Add instructions for mounting a VM's private storage in another VM
This commit is contained in:
awokd 2020-01-05 16:13:04 +00:00 committed by GitHub
commit a7119523e3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 0 deletions

View File

@ -42,6 +42,7 @@
- [restoring 3.2 templates/standalones to 4.0](system/restore-3.2.md)
- [connect to a VM console](system/vm-console.md)
- [display reminders to make regular backups](system/backup-reminders.md)
- [mount a VM's private storage volume in another VM](system/vm-image.md)
`user-setups`
- [examples of user setups](user-setups/) (templates and VMs used, productivity tips, customizations, ...)

26
docs/system/vm-image.md Normal file
View File

@ -0,0 +1,26 @@
# Mount a VM's private storage in another VM
Useful for data recovery. As per [this Reddit post](https://www.reddit.com/r/Qubes/comments/chgb3h/is_it_possible_to_access_files_inside_a_vm/f8ur03m/):
```
[dom0] sudo lvcreate --size 1G --snapshot --name tempsnap /dev/mapper/qubes_dom0-vm--untrusted--private
[dom0] readlink /dev/mapper/qubes_dom0-tempsnap
[dom0] qvm-start --hddisk dom0:/dev/[from previous command] viewervm
(Attaching to a running viewervm was not possible)
[viewervm] mkdir -v /tmp/stuff
[viewervm] sudo mount /dev/xvdi /tmp/stuff
```
If the original VM has more than one partition, have to pick the right one, such as xvdi1 or xvdi2, etcetera.
Could be unmounted, but no commands or options we tried allowed to detach the viewervm until it was stopped. (qvm-block still seems bugged)
Couldn't lvremove until the machine was restarted.