Skip to content

Instantly share code, notes, and snippets.

@jmnwong
Created February 12, 2014 16:34
Show Gist options
  • Save jmnwong/8959194 to your computer and use it in GitHub Desktop.
Save jmnwong/8959194 to your computer and use it in GitHub Desktop.
Install missing tun module and for Ubuntu 12.04/user-mode linux
sudo apt-get install uml-utilities build-essential linux-headers-`uname -r`
mkdir faketun
cd faketun
echo -e "#include <linux/module.h>\nstatic int start__module(void) {return 0;}\nstatic void end__module(void){return;}\nmodule_init(start__module);\nmodule_exit(end__module);">tun.c
echo -e "obj-m += tun.o\nall:\n\tmake -C /lib/modules/\$(shell uname -r)/build/ M=\$(PWD) modules\nclean:\n\tmake -C /lib/modules/\$(shell uname -r)/build/ M=\$(PWD) clean\nclean-files := Module.symvers">Makefile
make
sudo install tun.ko /lib/modules/`uname -r`/kernel/net/tun.ko
sudo depmod -a
sudo modprobe tun
@erm3nda
Copy link

erm3nda commented May 24, 2015

Did not test before for a previous install of faketun? If it's installed drops a lot of unnecesary errors.
Im my particular case i got a lot of them. I've created a pastebin with the info. http://pastebin.com/EJWYH5p1. Thank you.

@cahyowhy
Copy link

hmm this doesn't worked on linux kernel 5.4.0-1063-aws

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment