I have a secondary SSD that I always attach to the same VM (let’s call it target-vm). The SSD appears as dom0:nvme1n1. I want to attach it automatically when I start the computer. target-vm is started on boot. I can do this with:
qvm-block attach target-vm dom0:nvme1n1
Where can I run this command so it runs after target-vm has already booted up?
More details are needed about your target-vm and nvme1n1.
Did you try --persistent with privileges? Can you describe the whole process of what are you trying to do, step by step, until the goal fails?
As I said, this prevents target-vm from starting the next time I boot up the computer. I meant target-vm is an autostart VM. I think I wasn’t saying this clearly.
I now tried the opposite strategy: I unchecked “Start qube automatically on boot” in target-vm settings, and then tried to run this on /etc/rc.d/init.d/:
#!/usr/bin/bash
sleep 16
qvm-start target-vm
It doesn’t work either. target-vm isn’t started on boot up.
If it works when you manually attach, you can also use [3] or [4] (the latter if you need encryption or wish to attach different parts of the disk to different VMs) to do it for you.
Disclaimer: I’m the author.
Ah yes, you can do that. However it will only work once, i.e. not every time you start that VM e.g. via qubes-manager. Alternatively you could create a start shortcut for yourself that runs the commands when you click on it.
initd is not used by Qubes OS. Check out systemd to start stuff on boot. Alternatively use /etc/xdg/autostart (your display manager) with *.desktop files.
Note that traditional init scripts continue to function on a
systemd system. An init script /etc/rc.d/init.d/foobar is implicitly
mapped into a service unit foobar.service during system
initizalization.
But this doesn’t seem to true.
Am I right this is an “unreported issue” or am I missing something? Is it actually an upstream Fedora issue?