14.04 of the system does not have a Tun device by default, so you need to check this device by compiling it in the kernel. Next step is to describe how to install the Tun device.
First, update the Ubuntu Desktop version of the source:
sudo gedit/etc/apt/sources.list
deb http://mirrors.yun-idc.com/ubuntu/trusty main restricted universe Multiverse Deb Http://mirrors.yun-idc.com/ubuntu/trusty-security main restricted Universe Multiverse Deb/HTTP Mirrors.yun-idc.com/ubuntu/trusty-updates main restricted universe multiverse Deb http://mirrors.yun-idc.com/ubuntu/ trusty-proposed main restricted Universe Multiverse Deb Http://mirrors.yun-idc.com/ubuntu/trusty-backports main Restricted Universe Multiverse deb-src http://mirrors.yun-idc.com/ubuntu/trusty main restricted universe multiverse DEB-SRC http://mirrors.yun-idc.com/ubuntu/trusty-security main restricted Universe Multiverse DEB-SRC/http Mirrors.yun-idc.com/ubuntu/trusty-updates main restricted universe multiverse deb-src http://mirrors.yun-idc.com/ ubuntu/trusty-proposed main restricted universe multiverse deb-src http://mirrors.yun-idc.com/ubuntu/ Trusty-backports main restricted universe multiverse
sudo apt-get update
Second, compile the kernel source code (to ensure that your virtual machine storage is large enough, this article's virtual machine allocation 80G):
1, pre-compilation preparation, installation of the necessary dependencies:
Apt-get Install Libssl-dev Libncurses5-dev
2. Download the kernel version via the following link:
https://www.kernel.org/pub/linux/kernel/
3. Move the downloaded kernel linux-4.12.tar.xz to the/usr/src/directory and unzip it (the kernel version downloaded in this article is 4.12):
xz-d LINUX-4.12.TAR.XZTAR-XVF Linux-4.12.tar
4, Kernel clipping (will be TUN compiled into modules), the following three steps, device Drivers---->network Device Support----->universal TUN/TAP device driver Support
Make Menuconfig
Figure 1
Figure 2
Figure 3
When you see Figure 3, the Universal Tun/tap device driver Support option is <*>, press the keyboard ' m ' key, select this option, and then save the exit.
5. Compile the kernel
Make-j2
The make commands are now executed separately: Make Bzimage and make modules. Both the kernel and the module have been compiled. This directive generates kernel modules and Vmlinuz,initrd.img,symtem.map files that generate the appropriate kernel version.
6. Installing kernel modules
Make Modules_install
When the command finishes executing, the corresponding version of the kernel module is generated in the/lib/modules/directory.
Figure 4
7. Install the kernel
Make install
This instruction is to copy the original MAKE-J2 generated System.map, vmlinux,config,initrd.img files to the/boot/directory.
8. Reboot to complete the installation of the new kernel
Figure 5
Third, load the Tun module to the kernel
Modprobe Tunlsmod | grep Tun
Figure 6
Iv. Summary of Process errors
1, the Linux kernel compiles the scripts/sign-file.c:23:30:fatal error:openssl/opensslv.h error solution, installs the Libssl-dev
Apt-get Install Libssl-dev
2. Fatal error:curses.h:no such file or directory
Apt-get Install Libncurses5-dev
V. Summary
At this point the Tun module has been loaded in the kernel of ubuntu14.04, and some problems have been reported in the previous work, this article only provides the correct execution steps.
ubuntu14.04 Installing TUN/TAP network devices