How to install tun on Ubuntu 16.04 - ubuntu-16.04

I try to install tun on Ubuntu 16.04, it generates the tun.ko, but it still doesn't work.
1
Uname -a Linux host-name 4.10.0-42-generic #46~16.04.1-Ubuntu SMP Mon
Dec 4 15:57:59 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
2
apt-get install linux-source-4.10.0
3
cd /usr/src/linux-source-4.10.0 menuconfig->Device Drivers->Network
Device Support->Universal TUN/TAP device driver support
Then save it as tun.config.
4
make modules, it generate tun.ko under /drivers/net/ without err, then
copy it to lib/modules/4.10.0-42-generic/kernel/net/tun.ko.
And it still doesn't work. The command "modinfo tun" doesn't output anything.
Any advice about the install tun on Ubuntu 16.04?

You're probably on a VPS so you'll need to change this on your host settings.
Login to your VPS control panel using your username and password.
Click the ‘Manage’ button to the right of the VPS in which you want
to enable tun/tap
Under Controls -> Settings tab, click on ‘Enable TUN/TAP’
A dialog box appears asking for confirmation, hit yes
Source: https://www.copahost.com/blog/openvpn-in-ubuntu-tun-tap/
I had this problem myself and just fixed it by doing exactly this.

Related

Can not install semanage tool on RedHat virtual machine

I'm trying to change the MongoDB default port on my AWS Virtual Machine but semanage is not found on the server
semanage port -a -t mongod_port_t -p tcp 27042
-bash: semanage: command not found
Trying to find the package that provides semanage fails.
dnf whatprovides semanage
Errors during downloading metadata for repository 'rhui-client-config-server-8':
Curl error (58): Problem with the local SSL certificate for https://rhui3.eu-west-3.aws.ce.redhat.com/pulp/mirror/protected/rhui-client-config/rhel/server/8/x86_64/os [could not load PEM client certificate, OpenSSL error error:0200100D:system library:fopen:Permission denied, (no key found, wrong pass phrase, or wrong file format?)]
Error: Failed to download metadata for repo 'rhui-client-config-server-8': Cannot prepare internal mirrorlist: Curl error (58): Problem with the local SSL certificate for https://rhui3.eu-west-3.aws.ce.redhat.com/pulp/mirror/protected/rhui-client-config/rhel/server/8/x86_64/os [could not load PEM client certificate, OpenSSL error error:0200100D:system library:fopen:Permission denied, (no key found, wrong pass phrase, or wrong file format?)]
dnf update works and the system is up-to-date
Last metadata expiration check: 0:42:00 ago on Tue 21 Jul 2020 10:11:35 AM UTC.
Dependencies resolved.
Nothing to do.
Complete!
Additional informations :
cat /etc/redhat-release
Red Hat Enterprise Linux release 8.2 (Ootpa)
dnf repolist
repo id / repo name
mongodb-org-4.2 / MongoDB Repository
rhel-8-appstream-rhui-rpms / Red Hat Enterprise Linux 8 for x86_64 - AppStream from RHUI (RPMs)
rhel-8-baseos-rhui-rpms / Red Hat Enterprise Linux 8 for x86_64 - BaseOS from RHUI (RPMs)
rhui-client-config-server-8 / Red Hat Update Infrastructure 3 Client Configuration Server 8
Could you help me to install semanage please ? Thanks.
1.dnf install policycoreutils-python-utils
2. dnf provides semanage (This displays the same result as above-the path)
3. yum provides /usr/sbin/semanage
4. yum install policycoreutils-python
I fixed my issue using this.
You can also refer this link:
https://www.ostechnix.com/linux-troubleshooting-semanage-command-not-found-in-centos-7rhel-7/

Why is my gcloud command suddenly very slow inside WSL2

When I run a simple command, it takes about 10 seconds to complete,
λ time gcloud version
Google Cloud SDK 293.0.0
beta 2019.05.17
bq 2.0.57
core 2020.05.15
gsutil 4.50
real 0m9.731s
user 0m0.735s
sys 0m1.690s
λ uname -a
Linux LAPTOP-U7E4CROH 4.19.104-microsoft-standard #1 SMP Wed Feb 19 06:37:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
λ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal
I should note that I do not experience this slow behavior on the same laptop but within a git-bash environment - I only see this within WSL2 / Ubuntu.
I have tried to google around and I have found these two questions on SO, but they are not helping me:
google compute engine tool gcloud is exceptionally slow
Why gcloud command is slow to start?
Any ideas on how I can solve this?
I have the same issue and it turns out that in WSL 2 when I run gcloud it actually turn to use the gcloud installed on my Windows system.
Somehow it is very slow if you run the Windows gcloud from WSL 2, which is also never my intention.
I just disable appending Windows PATH to my WSL PATH all together after this.
But you know the root cause.
For the sake of completeness, to disable this feature, edit the /etc/wsl.conf to add the following section:
[interop]
appendWindowsPath = false
and terminate the WSL distro (wsl.exe --terminate <distro_name>) to make it immediately effective.
I had the same issue, resolved it by reinstalling the SDK: https://cloud.google.com/sdk/docs/downloads-interactive#linux
You must reinstall using 'Interactive installation', which replaces the previous installation and updates the PATH.
'Non-interactive (silent) deployment' does not seem to improve the issue.
Hope this helps.
I had the same issue and the only solution that worked for me was to set an alias for the gcloud command such that it gets executed by cmd.exe like so:
# in ~/.bashrc
alias gcloud="cmd.exe /c gcloud"
Then simply restart your terminal or run $ source ~/.bashrc, and the alias will take effect.
Of course, this assumes you have the gcloud CLI installed and added to your windows PATH.

How to set ControlMaster with Remote-SSH in Visual Studio Code?

I use Visual-Studio-Code with Remote-SSH extension and I don't want to authentiaction multiple times after I login. So I search the ControlMater option with ssh_config to setup.
After I connected and I got below error message.
Can't connect to Leo-OA: unreachable or not Linux x86_64 (packet_write_poll: Connection to UNKNOWN port -1: Permission denied)
My environment:
Client:
Visual Studio Code 1.35 Stable
Windows 10 1803
Server:
Ubuntu 16.04 LTS
Below is my setting file
# Read more about SSH config files: https://linux.die.net/man/5/ssh_config
Host STONE-OA
HostName 10.32.21.123
User rock
Host Leo-OA
HostName 10.32.21.123
User root
Port 60001
Host *
ControlMaster auto
ControlPath ~/.ssh/sockets/%r#%h-%p
ControlPersist 600
I want to know what is the main problem and how to fix. Thanks everybody.
This feature is not supported on Windows.
Simply running ssh on Windows with ControlMater in PowerShell without VS code has problem too. However you can use ControlMater in WSL without problem.
https://code.visualstudio.com/docs/remote/troubleshooting#_enabling-alternate-ssh-authentication-methods
If you are on macOS and Linux and want to reduce how often you have to enter a password or token, you can enable the ControlMaster feature on your local machine so that OpenSSH runs multiple SSH sessions over a single connection.

minikube start {OS type not recognized}

minikube start
giving below error messaage on Manjaro Deepin ( Arch Linux ).
E1002 00:02:24.832976 26272 start.go:143] Error starting host:
Temporary Error: Error configuring auth on host: OS type not
recognized.
tried it on VirtualBox with Ubuntu 16.04 and VT-X/AMD-v not enable error giving even Virtualbox preference set to VT-X/AMD-v enable.
Note : Need to fix the issue on my local machine not the virtualBox
uname -a output
Linux xxx-pc 4.9.51-1-MANJARO #1 SMP PREEMPT Wed Sep 20 10:37:40 UTC
2017 x86_64 GNU/Linux
If working on Linux, follow the steps:
Uninstall/delete all minikube related files
1. minikube delete
2. rm /usr/local/minikube
3. rm -rf ~/.minikube
Then do minikube start again. If it doesn't work uninstall & reinstall minikube.
For Windows user follow these steps:
Do minikube delete
Delete C:\Users\username\.minikube folder.
Do minikube start again.
Also, don't forget to stop all the process related to VirtualBox including VBoxHeadless before deleting minikube.
Please Enable VT-x on your computer's BIOS.
For Reference: https://kubernetes.io/docs/tasks/tools/install-minikube/

Vagrant is attempting to interface with the UI in a way that requires a TTY

Problem: vagrant up fails with the error below. I am running vagrant on Windows 7 and the base box is Ubuntu )( files.vagrantup.com/precise32.box ).
how can it be fixed?
vagrant.bat up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Clearing any previously set forwarded ports...
[default] Clearing any previously set network interfaces...
[default] Available bridged network interfaces:
1) Intel(R) PRO/1000 EB Network Connection with I/O Acceleration
2) Intel(R) PRO/1000 PL Network Connection
Vagrant is attempting to interface with the UI in a way that requires
a TTY. Most actions in Vagrant that require a TTY have configuration
switches to disable this requirement. Please do that or run Vagrant
with TTY.
Process finished with exit code 1
thanks
This worked for me on cygwin:
Or add this to ~/.bashrc:
export VAGRANT_DETECTED_OS=cygwin
Then I got the "Vagrant displays a message that it needs to run some internal upgrades..."
Edit - Oops! Spoke to soon. During its updates, I got Warning: Authentication failure. Retrying... until timeout :P
Edit 2 - I was able to fix it by setting config.ssh.private_key_path to the .vagrant.d/insecure_private_key in my Windows user's home directory.
I had the same error while destroying a Vagrant Box. I simply added -f and it did the job.
vagrant destroy m001 -f
This is happening because when script attempts vagrant destroy, Vagrant asks for [Yes/No] confirmation. Adding -f skips that.
I got the same error after upgrading Vagrant from 1.4 to 1.6.3 (Windows 7).
Running VAGRANT_HOME\bin\vagrant.exe manually resolved this issue for me:
Execute VAGRANT_HOME\bin\vagrant.exe
Vagrant displays a message that it needs to run some internal upgrades
"Press any key to continue"...
Once the process finished (it took several minutes), I was able to proceed with Vagrant instance launch as usual.
This is caused by Vagrant finding multiple Ethernet interfaces that can be used as public network and Vagrant cannot decide which one to use.
There are 3 options:
Deactivate one of the 2 adapters, so that Vagrant can use the other
Specify the Ethernet adapter you would like Vagrant to use in the vagrantfile. Like this:
app.vm.network "public_network", bridge: "Intel(R) PRO/1000 PL Network Connection"
Running the vagrant executable manually as already described in Al Belsky's answer
If you are on Windows and are starting Vagrant through MinGW (Git Bash for example) and get this message, try running it once through Windows' default cmd.exe. You are then able to answer the question about your network adapters.
I'm using Vagrant 1.7.4
Execute the below code before running vagrant up:
export VAGRANT_DETECTED_OS=cygwin
That will eliminate the exiting of vagrant and will allow you to choose Network Interface.
This may also be caused by not having Hardware Virtualization enabled in BIOS.
Also encountered this with Windows 10, when Vagrant cannot properly detect OS.
also can happen if you have both vmware and virtual box installed and you try to use MinGW.