# OpenVZ swap space error during install

**URL:** https://meta.discourse.org/t/openvz-swap-space-error-during-install/74958
**Category:** Self-hosting
**Tags:** server-resources
**Created:** [11월 28, 2017, 4:51오후 UTC](https://meta.discourse.org/t/openvz-swap-space-error-during-install/74958 "2017-11-28T16:51:36Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![hosyminh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hosyminh/32/83350_2.png) [@hosyminh](https://meta.discourse.org/u/hosyminh)
#### Post date: [11월 28, 2017, 4:51오후 UTC](https://meta.discourse.org/t/openvz-swap-space-error-during-install/74958/1 "2017-11-28T16:51:36Z")

</div>

```
./discourse-setup
WARNING: Discourse requires at least 2GB of swap when running with 2GB of RAM
or less. This system does not appear to have sufficient swap space.

Without sufficient swap space, your site may not work properly, and future
upgrades of Discourse may not complete successfully.

Ctrl+C to exit or wait 5 seconds to have a 2GB swapfile created.
2097152+0 records in
2097152+0 records out
2147483648 bytes (2.1 GB, 2.0 GiB) copied, 7.2644 s, 296 MB/s
Setting up swapspace version 1, size = 2 GiB (2147479552 bytes)
no label, UUID=6e02cc8b-b5af-412b-9121-3fc09f0055a0
swapon: /swapfile: swapon failed: Operation not permitted
/swapfile swap swap auto 0 0
sysctl: permission denied on key 'vm.swappiness'
vm.swappiness = 10
Failed to create swap, sorry!

```

help me !!

---

<div class="post-metadata">

### Author: ![hosyminh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hosyminh/32/83350_2.png) [@hosyminh](https://meta.discourse.org/u/hosyminh)
#### Post date: [11월 28, 2017, 4:55오후 UTC](https://meta.discourse.org/t/openvz-swap-space-error-during-install/74958/2 "2017-11-28T16:55:07Z")

</div>

root@CTR386846:/var/discourse# lsb\_release -a  
No LSB modules are available.  
Distributor ID: Ubuntu  
Description: Ubuntu 16.04.3 LTS  
Release: 16.04  
Codename: xenial  
root@CTR386846:/var/discourse#

---

<div class="post-metadata">

### Author: ![dimu001](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dimu001/32/80176_2.png) [@dimu001](https://meta.discourse.org/u/dimu001)
#### Post date: [11월 28, 2017, 4:57오후 UTC](https://meta.discourse.org/t/openvz-swap-space-error-during-install/74958/3 "2017-11-28T16:57:39Z")

</div>

what is the Ram capacity ?  
and host

you will have to create inough swap space

---

<div class="post-metadata">

### Author: ![hosyminh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hosyminh/32/83350_2.png) [@hosyminh](https://meta.discourse.org/u/hosyminh)
#### Post date: [11월 28, 2017, 4:58오후 UTC](https://meta.discourse.org/t/openvz-swap-space-error-during-install/74958/4 "2017-11-28T16:58:48Z")

</div>

CPU: Intel XEON E5645/X5650

- Core: CPU 2 Core
- Cloud storage: 25GB
- RAM: 2.5GB

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [11월 28, 2017, 5:06오후 UTC](https://meta.discourse.org/t/openvz-swap-space-error-during-install/74958/6 "2017-11-28T17:06:42Z")

</div>

What flavour of VPS is this? My guess is that you’re using a provider that gives you a container instead of a VM.

Can you please run: `apt-get install virt-what` and send the output of `virt-what`?

---

<div class="post-metadata">

### Author: ![hosyminh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hosyminh/32/83350_2.png) [@hosyminh](https://meta.discourse.org/u/hosyminh)
#### Post date: [11월 28, 2017, 5:12오후 UTC](https://meta.discourse.org/t/openvz-swap-space-error-during-install/74958/7 "2017-11-28T17:12:48Z")

</div>

root@CTR386846:/var/discourse# sudo virt-what  
openvz

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [11월 28, 2017, 5:18오후 UTC](https://meta.discourse.org/t/openvz-swap-space-error-during-install/74958/8 "2017-11-28T17:18:14Z")

</div>

Confirmed: openvz is a container-based virtualization system, not a full server. You won’t be able to add swap or change sysctls.

Using docker may also not work. If not, I suggest a container from a provider such as [Digitalocean](https://m.do.co/c/71b6e0acabc2).

---

<div class="post-metadata">

### Author: ![hosyminh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hosyminh/32/83350_2.png) [@hosyminh](https://meta.discourse.org/u/hosyminh)
#### Post date: [11월 28, 2017, 5:20오후 UTC](https://meta.discourse.org/t/openvz-swap-space-error-during-install/74958/9 "2017-11-28T17:20:03Z")

</div>

Thank ! if i don’t create swap  
=\> help me setup discourse ?

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [11월 28, 2017, 5:27오후 UTC](https://meta.discourse.org/t/openvz-swap-space-error-during-install/74958/10 "2017-11-28T17:27:22Z")

</div>

Can you run: `free -g --si` and show the output? `free -m --si` as well?

We may not be handling systems with 2.5GB correctly. If you do have 2.5GB, you can cheat by making the following change on line 108 of `discourse-setup` and rerunning the installer:

```diff
--- old/discourse-setup
+++ new/discourse-setup
@@ -108,7 +108,7 @@ check_disk_and_memory() {
   if ["$os_type" == "Darwin"]; then
     avail_mem=$(check_osx_memory)
   else
- avail_mem=$(check_linux_memory)
+ avail_mem=3
   fi
 
   if ["$avail_mem" -lt 1]; then

```

---

<div class="post-metadata">

### Author: ![hosyminh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hosyminh/32/83350_2.png) [@hosyminh](https://meta.discourse.org/u/hosyminh)
#### Post date: [11월 29, 2017, 1:21오전 UTC](https://meta.discourse.org/t/openvz-swap-space-error-during-install/74958/11 "2017-11-29T01:21:25Z")

</div>

i change discourse-setup and update

```
root@CTR386846:~# cd /var/discourse
root@CTR386846:/var/discourse# ./discourse-setup
-bash: ./discourse-setup: Permission denied
root@CTR386846:/var/discourse#

```

---

<div class="post-metadata">

### Author: ![hosyminh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hosyminh/32/83350_2.png) [@hosyminh](https://meta.discourse.org/u/hosyminh)
#### Post date: [11월 29, 2017, 1:26오전 UTC](https://meta.discourse.org/t/openvz-swap-space-error-during-install/74958/12 "2017-11-29T01:26:01Z")

</div>

`chmod -R 777 /var/discourse`

is ok =\> thanh so much

---

<div class="post-metadata">

### Author: ![hosyminh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hosyminh/32/83350_2.png) [@hosyminh](https://meta.discourse.org/u/hosyminh)
#### Post date: [11월 29, 2017, 1:29오전 UTC](https://meta.discourse.org/t/openvz-swap-space-error-during-install/74958/13 "2017-11-29T01:29:30Z")

</div>

Configuration file at containers/app.yml updated successfully!

Updates successful. Rebuilding in 5 seconds.  
Device “docker0” does not exist.  
Cannot connect to the docker daemon - verify it is running and you have access

real 0m0.063s  
user 0m0.037s  
sys 0m0.018s  
root@CTR386846:/var/discourse#

help me ??

Configuration file at containers/app.yml updated successfully!

Updates successful. Rebuilding in 5 seconds.  
Device “docker0” does not exist.  
Cannot connect to the docker daemon - verify it is running and you have access

real 0m0.038s  
user 0m0.012s  
sys 0m0.013s  
root@CTR386846:/var/discourse# service docker restart  
Job for docker.service failed because the control process exited with error code. See “systemctl status docker.service” and “journalctl -xe” for details.  
root@CTR386846:/var/discourse#  
root@CTR386846:/var/discourse#

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [11월 29, 2017, 3:56오전 UTC](https://meta.discourse.org/t/openvz-swap-space-error-during-install/74958/14 "2017-11-29T03:56:21Z")

</div>

> [@hosyminh](#):
>
> chmod -R 777 /var/discourse

This is a terrible idea. Next server, chmod the script to 755.

Your VPS does not support docker. I suggest a full VM from a different provider.
