Error openvz vps is not supported

Hi, I used your script on a VPS with CentOS 7. The installation runs smooth. I also can connect from the Wireguard iOS App. But I can't connect to any webpage. By manually starting up Wireguard...

@GuBo88

Hi,

I used your script on a VPS with CentOS 7. The installation runs smooth. I also can connect from the Wireguard iOS App. But I can’t connect to any webpage. By manually starting up Wireguard I run into the following problem:

root@GuBo ~]# wg-quick up wg0
[#] ip link add wg0 type wireguard
RTNETLINK answers: Operation not supported
Unable to access interface: Protocol not supported
[#] ip link delete dev wg0

Can you help?
Thanks

@4dfe-9dac

is this a client side error or a server side error??

@GuBo88

Dear,

World expect server. The WireGuard App on iOS works with another (commercial) Wireguard service. Also the App shows me the connection is established. And configuration is done by the generated QR code. Would I help if you can login to the VPS Server?

I can provide you with the login data by email.

Thanks
Thomas

The life is too short to drink a bad wine.

Am 28. Januar 2019 um 20:38:04, Prajwal Koirala (notifications@github.com(mailto:notifications@github.com)) schrieb:

@4dfe-9dac

@GuBo88

On Debian 9.2 (64-bit) Minimal and following the above steps I get the following error:
/usr/lib/wireguard_install.sh: line 146: /etc/iptables/rules.v4: No such file or directory
Failed to enable unit: File wg-quick@wg0.service: No such file or directory
Failed to start wg-quick@wg0.service: Unit wg-quick@wg0.service not found.

Thanks

@l-n-s

@GuBo88 looks like your server has problems with wireguard kernel module. Is it a virtual server? Does it allow kernel modules to be loaded?

@GuBo88

@l-n-s

@GuBo88 good, is it KVM or OpenVZ plan?

@GuBo88

OpenVZ and installing Kernel modules is not possible in OpenVZ at Liteserver. I need a KVM VPS from them.

@GuBo88

Any way to run Wireguard on OpneVZ?

@l-n-s
l-n-s

changed the title
Interface wg0 not found

OpenVZ is not supported. Script needs to detect it.

Jan 31, 2019

@l-n-s

You can install a userspace version of Wireguard, but it performs a lot worse than the kernel module. I’d suggest changing your VPS plan to KVM.

@hexicans

@l-n-s

No, it’s not. This instruction is for hosting providers, not for clients.

@hexicans

If I configure host and container, I can run a wireguard server I think

Home » General » Support » *SOLVED* vps not working

*SOLVED* vps not working [message #7149] Thu, 05 October 2006 10:56 Go to next message
molliver is currently offline 
molliver

Messages: 30
Registered: May 2006

Member

Hi,

I have just updated one of my guest vz systems to the lastest centos 4.4 via yum and then rebooted the vz instance. However I now can not get back into the vz instance. Either via ssh as i was before, telnet or vz enter.
Looking at the updates one was for glibc so i am wondering if this is causing a conflict and that the guest system is now not comming up properly.
I have also updated the host server to CentOs 4.4 via yum but have not yet rebooted, so it is usng kernel 2.6.8-022stab078.14.

Any ideas on how to solve this problem and get the guest booting again?
I can’t yet reboot do to people using the other virtual servers.

Regards

Mark

[Updated on: Fri, 06 October 2006 09:52] by Moderator

Report message to a moderator

Re: vps not working [message #7150 is a reply to message #7149] Thu, 05 October 2006 12:02 Go to previous messageGo to next message
Vasily Tarasov is currently offline 
Vasily Tarasov

Messages: 1345
Registered: January 2006

Senior Member

Hello,

Quote:
Any ideas on how to solve this problem and get the guest booting again?

Quote:
However I now can not get back into the vz instance. Either via ssh as i was before, telnet or vz enter.

So I don’t understand VE doesn’t start or it starts but enter fails? Anyway provide what exactly fails: output on the screen, logs, straces.

Thanks!

Re: vps not working [message #7151 is a reply to message #7150] Thu, 05 October 2006 12:13 Go to previous messageGo to next message
molliver is currently offline 
molliver

Messages: 30
Registered: May 2006

Member

Hi,

No the guest starts but you can not talk to it, as if it is in a semi runing state. Bellow is a strace of the start, you can start and stop other virtual servers which are not running CentOs4.4 and access them fine, but i have tried this on a couple of guests and once they are upgrades to CentOs 4.4 you then can not access them after reboot.

I have also included a strace of vzenter at the bottom,

Thanks

Mark,
p.s logs show no errors

[root@openvz1~]# strace vzctl start 104
execve("/usr/sbin/vzctl", ["vzctl", "start", "104"], [/* 19 vars */]) = 0
uname({sys="Linux", node="openvz1.thermeoneurope.com", ...}) = 0
brk(0)                                  = 0x8050000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/usr/lib/vzctl/lib/tls/i686/sse2/libvzctl.so.0.0.2", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/vzctl/lib/tls/i686/sse2", 0xbffff280) = -1 ENOENT (No such file or directory)
open("/usr/lib/vzctl/lib/tls/i686/libvzctl.so.0.0.2", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/vzctl/lib/tls/i686", 0xbffff280) = -1 ENOENT (No such file or directory)
open("/usr/lib/vzctl/lib/tls/sse2/libvzctl.so.0.0.2", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/vzctl/lib/tls/sse2", 0xbffff280) = -1 ENOENT (No such file or directory)
open("/usr/lib/vzctl/lib/tls/libvzctl.so.0.0.2", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/vzctl/lib/tls", 0xbffff280) = -1 ENOENT (No such file or directory)
open("/usr/lib/vzctl/lib/i686/sse2/libvzctl.so.0.0.2", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/vzctl/lib/i686/sse2", 0xbffff280) = -1 ENOENT (No such file or directory)
open("/usr/lib/vzctl/lib/i686/libvzctl.so.0.0.2", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/vzctl/lib/i686", 0xbffff280) = -1 ENOENT (No such file or directory)
open("/usr/lib/vzctl/lib/sse2/libvzctl.so.0.0.2", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/vzctl/lib/sse2", 0xbffff280) = -1 ENOENT (No such file or directory)
open("/usr/lib/vzctl/lib/libvzctl.so.0.0.2", O_RDONLY) = 3
read(3, "177ELF111331J365"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=125460, ...}) = 0
old_mmap(0x4ef50000, 122800, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x4ef50000
old_mmap(0x4ef6d000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1d000) = 0x4ef6d000
close(3)                                = 0
open("/usr/lib/vzctl/lib/libvzctl-simfs.so.0.0.2", O_RDONLY) = 3
read(3, "177ELF111331334271"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=7064, ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40000000
old_mmap(0x4ef4b000, 8648, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x4ef4b000
old_mmap(0x4ef4d000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x4ef4d000
close(3)                                = 0
open("/usr/lib/vzctl/lib/libdl.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=51364, ...}) = 0
old_mmap(NULL, 51364, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40001000
close(3)                                = 0
open("/lib/libdl.so.2", O_RDONLY)       = 3
read(3, "177ELF111331260[364"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=16800, ...}) = 0
old_mmap(0x4ef45000, 12388, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x4ef45000
old_mmap(0x4ef47000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x4ef47000
close(3)                                = 0
open("/usr/lib/vzctl/lib/libutil.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/libutil.so.1", O_RDONLY)     = 3
read(3, "177ELF111331220214"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=15916, ...}) = 0
old_mmap(0x4f578000, 12428, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x4f578000
old_mmap(0x4f57a000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x4f57a000
close(3)                                = 0
open("/usr/lib/vzctl/lib/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/tls/libc.so.6", O_RDONLY)    = 3
read(3, "177ELF111331320316"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1525004, ...}) = 0
old_mmap(0x4ee18000, 1223900, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x4ee18000
old_mmap(0x4ef3d000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x124000) = 0x4ef3d000
old_mmap(0x4ef41000, 7388, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4ef41000
close(3)                                = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4000e000
mprotect(0x4ef47000, 4096, PROT_READ)   = 0
mprotect(0x4f57a000, 4096, PROT_READ)   = 0
mprotect(0x4ef3d000, 8192, PROT_READ)   = 0
mprotect(0x4ee14000, 4096, PROT_READ)   = 0
set_thread_area({entry_number:-1 -> 6, base_addr:0x4000e8e0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
munmap(0x40001000, 51364)               = 0
brk(0)                                  = 0x8050000
brk(0x8071000)                          = 0x8071000
rt_sigaction(SIGPIPE, {SIG_IGN}, NULL, 8) = 0
open("/usr/lib/vzctl/modules/", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = -1 ENOENT (No such file or directory)
open("/etc/vz/vz.conf", O_RDONLY)       = 3
stat64("/etc/vz/vz.conf", {st_mode=S_IFREG|0644, st_size=695, ...}) = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=695, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40001000
read(3, "# Global parametersnVIRTUOZZO=ye"..., 4096) = 695
read(3, "", 4096)                       = 0
close(3)                                = 0
munmap(0x40001000, 4096)                = 0
open("/var/log/vzctl.log", O_WRONLY|O_APPEND|O_CREAT, 0666) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=8456, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40001000
fstat64(3, {st_mode=S_IFREG|0644, st_size=8456, ...}) = 0
_llseek(3, 8456, [8456], SEEK_SET)      = 0
stat64("/etc/vz//conf//104.conf", {st_mode=S_IFREG|0644, st_size=940, ...}) = 0
open("/etc/vz//conf//104.conf", O_RDONLY) = 4
stat64("/etc/vz//conf//104.conf", {st_mode=S_IFREG|0644, st_size=940, ...}) = 0
fstat64(4, {st_mode=S_IFREG|0644, st_size=940, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40002000
read(4, "ONBOOT="yes"nNUMPROC="2666:2666""..., 4096) = 940
read(4, "", 4096)                       = 0
close(4)                                = 0
munmap(0x40002000, 4096)                = 0
fcntl64(0, F_GETFL)                     = 0x8002 (flags O_RDWR|O_LARGEFILE)
fcntl64(1, F_GETFL)                     = 0x8002 (flags O_RDWR|O_LARGEFILE)
fcntl64(2, F_GETFL)                     = 0x8002 (flags O_RDWR|O_LARGEFILE)
open("/dev/vzctl", O_RDWR)              = 4
ioctl(4, 0x400c2e05, 0xbffff530)        = 0
stat64("/vz/lock", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
gettimeofday({1160050134, 122284}, NULL) = 0
getpid()                                = 14975
open("/vz/lock/104.lckc6eGRN", O_RDWR|O_CREAT|O_EXCL, 0600) = 5
write(5, "14975nn", 7)                = 7
close(5)                                = 0
link("/vz/lock/104.lckc6eGRN", "/vz/lock/104.lck") = 0
unlink("/vz/lock/104.lckc6eGRN")        = 0
rt_sigaction(SIGINT, {SIG_IGN}, NULL, 8) = 0
ioctl(4, 0x400c2e05, 0xbffff540)        = -1 ESRCH (No such process)
ioctl(4, 0x400c2e05, 0xbffff3b0)        = -1 ESRCH (No such process)
stat64("/etc/vz/dists/centos-4-i386-general.conf", 0xbfffedac) = -1 ENOENT (No such file or directory)
stat64("/etc/vz/dists/centos-4-i386.conf", 0xbfffedac) = -1 ENOENT (No such file or directory)
stat64("/etc/vz/dists/centos-4.conf", {st_mode=S_IFREG|0644, st_size=963, ...}) = 0
open("/etc/vz/dists/centos-4.conf", O_RDONLY) = 5
fstat64(5, {st_mode=S_IFREG|0644, st_size=963, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40002000
read(5, "#  Copyright (C) 2000-2006 SWsof"..., 4096) = 963
stat64("/etc/vz/dists/scripts/redhat-add_ip.sh", {st_mode=S_IFREG|0755, st_size=4942, ...}) = 0
stat64("/etc/vz/dists/scripts/redhat-del_ip.sh", {st_mode=S_IFREG|0755, st_size=1880, ...}) = 0
stat64("/etc/vz/dists/scripts/redhat-set_hostname.sh", {st_mode=S_IFREG|0755, st_size=1815, ...}) = 0
stat64("/etc/vz/dists/scripts/set_dns.sh", {st_mode=S_IFREG|0755, st_size=1668, ...}) = 0
stat64("/etc/vz/dists/scripts/set_userpass.sh", {st_mode=S_IFREG|0755, st_size=1519, ...}) = 0
stat64("/etc/vz/dists/scripts/set_ugid_quota.sh", {st_mode=S_IFREG|0755, st_size=1898, ...}) = 0
stat64("/etc/vz/dists/scripts/postcreate.sh", {st_mode=S_IFREG|0755, st_size=2104, ...}) = 0
read(5, "", 4096)           


[Updated on: Fri, 06 October 2006 07:32] by Moderator

Report message to a moderator

Re: vps not working [message #7182 is a reply to message #7179] Fri, 06 October 2006 09:29 Go to previous messageGo to next message
Vasily Tarasov is currently offline 
Vasily Tarasov

Messages: 1345
Registered: January 2006

Senior Member

[pid   650] open("/dev/ptmx", O_RDWR)   = -1 ENOENT (No such file or directory)
[pid   650] open("/dev/ptyp0", O_RDWR)  = -1 ENOENT (No such file or directory)

I have a guest, that after centos update udev were installed there.
If it is so, you should turn off udev in VE and copy contents of /dev from working VE to the VE in question.

HTH,
vass.

Re: vps not working [message #7184 is a reply to message #7183] Fri, 06 October 2006 09:42 Go to previous messageGo to next message
molliver is currently offline 
molliver

Messages: 30
Registered: May 2006

Member

Hm, nasty problem,

It did solve the problem, i found where to turn off udev in /etc/rc.sysinit, then coppied /dev from another guest.

I wonder why it only upgraded to udev on the virtual os and not on the host kernel which i had also upgraded???

Thanks

Mark

Re: vps not working [message #26807 is a reply to message #7184] Fri, 01 February 2008 09:56 Go to previous messageGo to next message
fransonline is currently offline 
fransonline

Messages: 22
Registered: May 2006

Junior Member

molliver wrote on Fri, 06 October 2006 05:42
… i found where to turn off udev in /etc/rc.sysinit, then coppied /dev from another guest….
Mark

Disabling udev in /etc/rc.sysinit did the trick on my VPS with pty problem.

Just wondering if disabling udev has consequences for good and safe working of my VPS.

Anyone with information about this issue?

Thanks for your time and have a nice day!

Frans

Re: *SOLVED* vps not working [message #29417 is a reply to message #7149] Sat, 12 April 2008 10:39 Go to previous messageGo to next message
SoftDux is currently offline 
SoftDux

Messages: 55
Registered: November 2007
Location: Johannesburg, South Afric…

Member

Hi

I also had the same problem where I can’t enter the VEID, gave me the «Unable to open pty: No such file or directory» error:

vzctl enter 1001
enter into VE 1001 failed
Unable to open pty: No such file or directory

So, I have edited /vz/private/1001/etc/rc.sysconfig & commented udev out, then copies /dev from a newly created VE — which then allowed me to login to the VE again, but with the following error:

VE start in progress...
entered into VE 1001
Unable to get tty name: Bad file descriptor
                                           root@vps03 [/]#

Is this a problem?

Running df -H, I get the following:

 df -H
Filesystem             Size   Used  Avail Use% Mounted on
simfs                  8.9G   3.5G   4.6G  44% /
df: `(deleted) /var/tmp': No such file or directory

Why is that happening? I don’t know what this even means, exactly, so I won’t know what to tell the client if he asks me.

Re: *SOLVED* vps not working [message #29424 is a reply to message #29423] Sat, 12 April 2008 11:24 Go to previous message
SoftDux is currently offline 
SoftDux

Messages: 55
Registered: November 2007
Location: Johannesburg, South Afric…

Member

fransonline wrote on Sat, 12 April 2008 13:16
Sometimes this helps also:
On the node:
vzctl exec <<VZID>> /sbin/MAKEDEV ptyp
vzctl exec <<VZID>> /dev/MAKEDEV tty
vzctl exec <<VZID>> /dev/MAKEDEV pty

That didn’t work. From another thread I ended up creating a new VE from the same template, then disabled udev in the current
VE’s private folder — /vz/private/1001/etc/rc.sysconfig — and then copied the /dev folder from the new VE to the current one

fransonline wrote on Sat, 12 April 2008 13:16

The temp error: I should not know.
It looks as if it’s no longer there, so create a new /var/tmp…

Frans

It was actually there, but as file, and not a folder — odd. I’ve deleted it & recreated it

Goto Forum:

Current Time: Thu Feb 09 14:56:35 GMT 2023

Total time taken to generate the page: 0.01415 seconds

There are a lot of great setup guides, but many seemed to have something missing. These are the steps I took to get WG working in this environment (note: this was all as «root’):

apt-get update && apt-get -y upgrade
apt-get -y install nano bash-completion wget git
apt-get -y install software-properties-common
add-apt-repository ppa:wireguard/wireguard
apt-get update && apt-get -y upgrade
apt install wireguard-tools --no-install-recommends

Then, to enable forwarding:

nano /etc/sysctl.conf

And uncomment the following lines:

net.ipv4.ip_forward=1
net.ipv6.conf.all.forwarding=1

Once saved, reboot. You could «sysctl -p», but just makes sure all updates/upgrades/changes are in place properly

reboot

And just for giggles. I recommend this because I did have things not complete fully in one case — so better safe than sorry.

apt-get update && apt-get -y upgrade

Now, we are going to use wireguard-go, so need to install «go». I used 1.13.4, but just change «go1.13.4» in each of the following lines if wish to try a differen version:

cd /tmp
wget https://dl.google.com/go/go1.13.4.linux-amd64.tar.gz
tar zvxf go1.13.4.linux-amd64.tar.gz
mv go /opt/go1.13.4
ln -s /opt/go1.13.4/bin/go /usr/local/bin/go

Now, download and install wireguard-go itself

cd /usr/local/src
git clone https://git.zx2c4.com/wireguard-go
cd wireguard-go
make
cp wireguard-go /usr/local/bin

Reboot to ensure everything is clean

reboot

Check to see if working/version

wireguard-go --version

Generate private and public keys

cd /etc/wireguard/
umask 077
wg genkey | tee privatekey | wg pubkey > publickey
#write down the public key:
cat publickey
#write down the private key:
cat privatekey

Define wg0 interface by creating «wg.conf».

cd /etc/wireguard/
nano wg0.conf

And copy the following into the file (changing private key and address as appropriate). An example address would be 10.100.1.1/24. One note, you may need to change venet0 to your proper interface (eth0 as an example — venet0 works well for the OpenVZ node I installed this on):

[Interface]
PrivateKey = <Private Key>
Address = ###.###.###.1/24
ListenPort = 51820
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o venet0 -j MASQUERADE; ip6tables -A FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -A POSTROUTING -o venet0 -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o venet0 -j MASQUERADE; ip6tables -D FORWARD -i wg0 -j ACCEPT; ip6tables -t nat -D POSTROUTING -o venet0 -j MASQUERADE
SaveConfig = true

Modify the service to support wireguard-go:

nano  /lib/systemd/system/wg-quick@.service

Find the line «Environment=WG_ENDPOINT_RESOLUTION_RETRIES=infinity» and add:

Environment=WG_I_PREFER_BUGGY_USERSPACE_TO_POLISHED_KMOD=1

Enable and start the service

systemctl enable wg-quick@wg0
systemctl start wg-quick@wg0

Now, for each client, execute the following on the server. The address would exist in the /24 range noted above. For example, 10.100.1.2/32 would be appropriate here:

wg set wg0 peer <peer public key> allowed-ips ###.###.###.###/32

Assuming your client is set up correctly, all should flow. Depending on the environment, you may need the following to enable and configure the firewall (ufw firewall):

ufw allow 22/tcp
ufw allow 51820/udp
ufw enable

You also may need to add the following if the default firewall policy is to REJECT:

iptables -A INPUT -p udp -m udp --dport 51820 -j ACCEPT
iptables -A OUTPUT -p udp -m udp --sport 51820 -j ACCEPT

And finally, if you are running this on OpenVZ, you may need to (at the host level — so need to talk to your service provider):

vzctl set $CTID --netfilter full --save

Once all this is done, reboot and you should be set. You can verify wireguard is running and its configuration with:

wg

or

wg show

And you should see something like:

root@vps-wg:~# wg show

interface: wg0
  public key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  private key: (hidden)
  listening port: 51820

peer: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  endpoint: 111.111.111.:57805
  allowed ips: 10.100.1.3/32
  latest handshake: 6 hours, 5 minutes, 23 seconds ago
  transfer: 4.60 MiB received, 16.87 MiB sent

peer: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  allowed ips: 10.100.202.2/32

Recommend Projects

  • React photo

    React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo

    Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo

    Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo

    TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo

    Django

    The Web framework for perfectionists with deadlines.

  • Laravel photo

    Laravel

    A PHP framework for web artisans

  • D3 photo

    D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Visualization

    Some thing interesting about visualization, use data art

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo

    Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo

    Microsoft

    Open source projects and samples from Microsoft.

  • Google photo

    Google

    Google ❤️ Open Source for everyone.

  • Alibaba photo

    Alibaba

    Alibaba Open Source for everyone

  • D3 photo

    D3

    Data-Driven Documents codes.

  • Tencent photo

    Tencent

    China tencent open source team.

User avatar

Holmes.Sherlock

OpenVPN User
Posts: 40
Joined: Wed Jul 06, 2011 4:51 am

OpenVZ kernel does not support TUN/TAP devices

Hi,

It’s me posting in this forum after a long time.

I registered for a free OpenVZ based VPS (Virtual Private Server) yesterday & tried to configure OpenVPN on it. Earlier, I did the same with a Xen based VPS solution. Everything worked like a charm. When I attempted to start VPN server, below is the error I encountered:

Tue May 22 01:04:47 2012 Note: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)
Tue May 22 01:04:47 2012 Note: Attempting fallback to kernel 2.2 TUN/TAP interface
Tue May 22 01:04:47 2012 Cannot allocate TUN/TAP dev dynamically
Tue May 22 01:04:47 2012 Exiting

I didn’t find any TUN/TAP adapter by issuing

To load the TUN module manually, I did this, but nothing was loaded.

Then I tried to find whether any TUN related module is present in the kernel

No result returned.

I did all the steps listed here

Code: Select all

    Enter mknod /dev/net/tun c 10 200
    Enter chmod 600 /dev/net/tun
    Enter cat /dev/net/tun to test whether the TUN/TAP device is available:
        If you receive the message cat: /dev/net/tun: File descriptor in bad state your TUN/TAP device is ready for use
        If you receive the message cat: /dev/net/tun: No such device the TUN/TAP device was not successfully created: contact VPSLink Support for assistance 

Please note that the TUN/TAP device will be removed if you reinstall your operating system template. 

But no luck.

At this point I am sure that the OpenVZ kernel is not complied with the support for required modules. What I am asking is whether there any alternative to having native support for TUN/TAP drivers, i.e. can any third-party drivers be installed for creation of TUN/TAP devices to be used in conjunction with OpenVPN?

Reference 1
Reference 2
Reference 3
OpenVZ-Users-Guide: Page 69


User avatar

Mimiko

Forum Team
Posts: 1564
Joined: Wed Sep 22, 2010 3:18 am

Re: OpenVZ kernel does not support TUN/TAP devices

Post

by Mimiko » Wed May 23, 2012 5:56 am

TUN devices a somekind standart. You can search for sources and compile them. Better ask the hosters of VPS to help, as they have power to add such devices.


User avatar

Holmes.Sherlock

OpenVPN User
Posts: 40
Joined: Wed Jul 06, 2011 4:51 am

Re: OpenVZ kernel does not support TUN/TAP devices

Post

by Holmes.Sherlock » Wed May 23, 2012 6:49 am

Hi Mimiko, good to see you again. Few months back, I was immensely helped by you & janjust

Mimiko wrote:TUN devices a somekind standart.

I didn’t get you. Means?

Better ask the hosters of VPS to help, as they have power to add such devices.

Even having root access, can’t I add the TUN/TAP support?


User avatar

Mimiko

Forum Team
Posts: 1564
Joined: Wed Sep 22, 2010 3:18 am

Re: OpenVZ kernel does not support TUN/TAP devices

Post

by Mimiko » Wed May 23, 2012 6:56 am

The TUN device is a standart device like NUL or COM in the meaning of working. But source code may differ.

In a VPS even if you have root access, the real kernel is protected and for VPS host perspective, for each VPS a clone (or a module) is running, not the real kernel. TUN devices must be closed to kernel, so you can’t use it in the VPS without the admins of the VPS host including them in base kernel and allow to share to guest VPS.


User avatar

Holmes.Sherlock

OpenVPN User
Posts: 40
Joined: Wed Jul 06, 2011 4:51 am

Re: OpenVZ kernel does not support TUN/TAP devices

Post

by Holmes.Sherlock » Wed May 23, 2012 7:01 am

Mimiko wrote:
In a VPS even if you have root access, the real kernel is protected and for VPS host perspective, for each VPS a clone (or a module) is running, not the real kernel.

I think, with my little knowledge, that whatever you have written about kernel sharing, is applicable to OpenVZ based virtualization solution, i.e. fits my case.

Xen based platforms, probably, works in a different way where a dedicated kernel is allocated per VM.


yzkwkw

OpenVpn Newbie
Posts: 1
Joined: Thu May 24, 2012 8:54 am

Re: OpenVZ kernel does not support TUN/TAP devices

Post

by yzkwkw » Thu May 24, 2012 9:03 am

I had almost the same problem. I set up a vps days ago, and i asked the provider to enable tun/tap and they did. after that i installed openvpn on the vps and it worked fine. but yesterday wanted to set the pptpd too, and i asked the provider to enable the ppp module and they also enable it. but then problem came, my openvpn service could not start anymore. the openvpn.log showed that:
——
Note: Cannot open TUN/TAP dev /dev/net/tun: Permission denied (errno=13)
Note: Attempting fallback to kernel 2.2 TUN/TAP interface
Cannot allocate TUN/TAP dev dynamically
Exiting
———-
but i cat the /dev/net/tun it returned:
[root@-]# cat /dev/net/tun
cat: /dev/net/tun: File descriptor in bad state
———
which meaned it seems to work fine, and the vps tech support did not provide further support.
I could not figure out why. i think maybe there are some bugs in the openvpn? after reenable the tun, it can’t regonize it again? or maybe the tun module just not enabled correctly? but the tech support insisted it worked fine.


User avatar

Mimiko

Forum Team
Posts: 1564
Joined: Wed Sep 22, 2010 3:18 am

Re: OpenVZ kernel does not support TUN/TAP devices

Post

by Mimiko » Sat May 26, 2012 6:34 am

yzkwkw, ask provider to disable ppp interface, and see what is happening.

When OpenVPN was working only with tun adapter enabled on host, did you ever restarted your VPS? After a restart did tun initialized correctly?


manuel19

OpenVpn Newbie
Posts: 18
Joined: Thu Jun 14, 2012 10:39 pm

Re: OpenVZ kernel does not support TUN/TAP devices

Post

by manuel19 » Wed Jul 25, 2012 11:25 pm

You have to ask your Linux VPS provider to install the TUN/TAP drivers.

I was using an OpenVZ server, it doesn’t have the TUN/TAP drives, so I wrote a ticket to the Support and they install the TUN/TAP drivers for me.

Hope this help you.

Regards, Manuel.


User avatar

Holmes.Sherlock

OpenVPN User
Posts: 40
Joined: Wed Jul 06, 2011 4:51 am

Re: OpenVZ kernel does not support TUN/TAP devices

Post

by Holmes.Sherlock » Thu Jul 26, 2012 9:37 am

manuel19 wrote:You have to ask your Linux VPS provider to install the TUN/TAP drivers.

I was using an OpenVZ server, it doesn’t have the TUN/TAP drives, so I wrote a ticket to the Support and they install the TUN/TAP drivers for me.

Which VPS service are you using?


manuel19

OpenVpn Newbie
Posts: 18
Joined: Thu Jun 14, 2012 10:39 pm

Re: OpenVZ kernel does not support TUN/TAP devices

Post

by manuel19 » Thu Jul 26, 2012 1:44 pm

It doesn’t matters. Your VPS Provider have the obligation to install something you really want and that is not installed by default in the servers they sell.

If i bought a car to you, the car obliously need 4 tires to run. If the car only have 3, you (the seller) need to buy the other tire, because you are buying a functional car. Any car will run correctly with 3 tires.

So, you provider need to install for you the tire #4, in this case, the TUN/TAP driver.

A normal VPS machine in Linux, need to have installed the TUN/TAP without any extra cost.



Jeroma11

OpenVpn Newbie
Posts: 2
Joined: Thu May 08, 2014 8:04 am

Re: OpenVZ kernel does not support TUN/TAP devices

Post

by Jeroma11 » Thu May 08, 2014 8:05 am

This is very usefully for me :)


Понравилась статья? Поделить с друзьями:
  • Error opening v4l interface no such file or directory
  • Error opening the destination file ahk
  • Error opening tftp permission denied
  • Error opening terminal xterm kitty
  • Error opening terminal unknown