Getting commands to run on boot for Ubuntu 14.04

Soldato
Joined
18 Oct 2002
Posts
12,745
Hi Folks,

I'm trying to get two commands to run on boot for my machine. To run them when I have booted, I type:

sudo modprobe -r vfio_iommu_type1

sudo modprobe vfio_iommu_type1 allow_unsafe_interrupts=1

These, if you care, are commands that allow my KVM install to allow my pfsense VM have PCI Passthrough access to a network card in the machine.

Any suggestions would be hugely appreciated :)
 
So in short you just want to have that option set on boot for that module?

The following should sort it for you:
Code:
echo "options vfio_iommu_type1 allow_unsafe_interrupts=1" | sudo tee -a /etc/modprobe.d/vfio_iommu_type1.conf
 
Yes. It doesn't seem to stay persistent when I reboot.

what file do I need to put that into - sorry - or are you saying just run that at the terminal prompt?

I only ask as someone suggested there is a modules file to put the commands in - I did that and it didn't work

http://ubuntuforums.org/showthread.php?t=783109

I think the problem I have is because my first comment is using -r

I was told to put it in with the -r on the end, so effectively in my /etc/modules file I have

vfio_iommu_type1 -r
vfio_iommu_type1 allow_unsafe_interrupts =1
 
Last edited:
OK, I've edited this response as quite frankly, my post was far to encompassing.

Is this module a default one in the kernel? Provided you've done no prior configuration, if you run before running your usual commands:
Code:
lsmod | grep vfio_iommu_type1
and get an output, it is. This means you can just run my previous command and it should work.

Otherwise, I'd simply follow this guide to get you going: http://hinish.com/?p=338 Doing it via GRUB essentially guarantees it'll work with little configuration.

If the first option didn't work but you want to use the module configuration files in the OS itself, take a look at the ArchWiki page on kernel modules. Personally I'd rather do it with module configuration files to keep the boot loader entries as clean as possible and the configuration as logical as possible, but the above is easier.
 
Last edited:
Back
Top Bottom