From 2a39adfe0fee9dd7fd3485a20b6dabc18494f137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sun, 4 Oct 2015 23:07:10 +0200 Subject: [PATCH] Enlarge /tmp and /dev/shm Initial size of those tmpfs-mounted directories is calculated as 50% of RAM at VM startup time. Which happen to be quite small number, like 150M. Having such small /tmp and/or /dev/shm apparently isn't enough for some applications like Google chrome. So set the size statically at 1GB, which would be the case for baremetal system with 2GB of RAM. Fixes QubesOS/qubes-issues#1003 --- Makefile | 1 + misc/fstab | 2 +- rpm_spec/core-vm.spec | 1 + vm-systemd/tmp.mount.d/30_qubes.conf | 4 ++++ 4 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 vm-systemd/tmp.mount.d/30_qubes.conf diff --git a/Makefile b/Makefile index a60bf9d..17d7276 100644 --- a/Makefile +++ b/Makefile @@ -54,6 +54,7 @@ DROPIN_DIR ?= "lib/systemd/system" # Fedora Dropins DROPINS := chronyd.service crond.service cups.service cups.path cups.socket ModemManager.service DROPINS += NetworkManager.service NetworkManager-wait-online.service ntpd.service getty@tty.service +DROPINS += tmp.mount # Debian Dropins ifeq ($(shell lsb_release -is), Debian) diff --git a/misc/fstab b/misc/fstab index 81e6f18..dbc5a7d 100644 --- a/misc/fstab +++ b/misc/fstab @@ -5,7 +5,7 @@ /dev/xvdb /rw auto noauto,defaults,discard 1 2 /rw/home /home none noauto,bind,defaults 0 0 /dev/xvdc1 swap swap defaults 0 0 -tmpfs /dev/shm tmpfs defaults 0 0 +tmpfs /dev/shm tmpfs defaults,size=1G 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 sysfs /sys sysfs defaults 0 0 proc /proc proc defaults 0 0 diff --git a/rpm_spec/core-vm.spec b/rpm_spec/core-vm.spec index 7cd0e35..0c7f3f0 100644 --- a/rpm_spec/core-vm.spec +++ b/rpm_spec/core-vm.spec @@ -555,6 +555,7 @@ The Qubes core startup configuration for SystemD init. /lib/systemd/system/NetworkManager.service.d/30_qubes.conf /lib/systemd/system/NetworkManager-wait-online.service.d/30_qubes.conf /lib/systemd/system/ntpd.service.d/30_qubes.conf +/lib/systemd/system/tmp.mount.d/30_qubes.conf %post systemd diff --git a/vm-systemd/tmp.mount.d/30_qubes.conf b/vm-systemd/tmp.mount.d/30_qubes.conf new file mode 100644 index 0000000..8c189c7 --- /dev/null +++ b/vm-systemd/tmp.mount.d/30_qubes.conf @@ -0,0 +1,4 @@ +[Mount] +# Default initial size is '50%' (of physical RAM at system startup) +# Because of memory ballooning this happen to be very low number +Options=mode=1777,strictatime,size=1G