Simply do this :


# mount -t tmpfs -o noexec,nosuid tmpfs /tmp/
# cat /proc/mounts
simfs / simfs rw 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
devpts /dev/pts devpts rw 0 0
tmpfs /dev/shm tmpfs rw 0 0
tmpfs /tmp tmpfs rw,nosuid,noexec 0 0

and dont forget to insert to /etc/fstab :

tmpfs /tmp tmpfs noexec,nosuid 0 0
tmpfs /var/tmp tmpfs noexec,nosuid 0 0

Creating OpenVZ OSTemplate

October 27, 2009

Actually this article is not about creating OS template. Well, it’s about when you done customizing some OS Template and you want to backup or make it as a new pre-configured OS template :

  1. Shutdown your OpenVZ container : vzctl stop {CTID}
  2. As root, go to /vz/private/{CTID} and launch : tar -cvzf /vz/template/cache/{OSTemplate-Name}.tar.gz .