-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement live boot by porting grub-live to Qubes - amnesia / non-persistent boot / anti-forensics #4982
Comments
I haven't looked at this in details, but I guess it's similar thing was done for Qubes live (a device mapper or overlayfs with a writable layer in ram). And the main problem there is the amount of changes you need to keep in ram. When normal live system would generate for example 300MB of delta, in Qubes you have this multiplied by a number of VMs (dom0 + sys-net,sys-firewall,sys-whonix and possibly sys-usb). This added to standard Qubes memory requirements, result in something not feasible to run on broadly available machines. As far I remember development of Qubes 3.2 live, on a hardware with 8GB you run out of memory in minutes of usage. |
I tried the official USB live image from the Qubes website in a VM an it indeed just crashes after a while just by starting and stopping a few VMs. I think this is related to how live systems are normally implemented in Fedora. They make use of device mapper which writes changed blocks to RAM but the problem is it never gives them back even when they are not used anymore. In contrast overlayfs works on the file level and does not have this issue. A disadvantage is, however, that files which are opened for writing or just by changing permissions will first all be copied to RAM. I think this would be problematic for large files i.e. HVMs which could then easily occupy all of the available memory (unless they are configured as a live system themselves) I think logging itself would not create too much overhead. But if each VM downloads its own repo files then this could of course easily occupy some hundred MB. Could you maybe give a number what amount of data a Qubes Fedora or Debian VM downloads automatically? |
overlayfs with disk images doesn't sound good. It would be copied to RAM on very small modification. This is especially a problem for TemplateVMs. Anyway, optimizing our templates to write less data would be beneficial not only to Live USB system, but for general use too. |
I tried it with Qubes 4.0 now and actually just the mounted rootfs is kind of a live system i.e. dom0. |
volatile image is one of disk images connected to every VM, see here for details. As for Qubes 4.0, you can try installing it with btrfs storage layout - it will use files to store VMs data instead of LVM. |
I tested an installation of 4.0 with just /boot and encrypted / with ext4. In this case also all VMs are stored in the main partition. In general every file operation which opens large files for writing would need to be disabled for such a live system to be feasible. Or alternatively maybe the size of the images which need to be writable needs to be reduced significantly. Do you see any chance for those options? |
You can find here my (very) old attempts at making it work, by selectively handling some files with overlayfs, some with dm-snapshot and some storing in tmpfs directly. Even with the problem of copying whole disk images to RAM on first open reduced to minimum, it was barely usable as described in #4982 (comment) |
https://github.com/Kicksecure/grub-live [0] is a tiny, simple package with a few dependencies (available from packages.debian.org) that can be installed on Debian [1] hosts which adds a live boot menu entry, which means, the operating system gets booted non-persistently. All changes go to RAM instead of disk.
It might not be perfectly amnesic as per [1], [2] but it might be a huge step towards amnesic Qubes?
Not tested for anti-forensics yet but should be doable to test. [4]
Could grub-live be ported to Qubes? Am I overlooking something?
//cc @Algernon-01 (original author of grub-live)
The text was updated successfully, but these errors were encountered: