Proxmox Ubuntu 14.04 Container

Creating the Ubuntu Container

  1. Download the Ubuntu 14.04 template from OpenVZ
  2. Log into Proxmox and upload the template to the appropriate storage location
  3. Click Create CT
  4. Create the new container with your desired settings
  5. Choose the newly uploaded template to use for the container
  6. When Proxmox reports TASK OK, the container is finished
  7. Start the container

Using NFS within a Container

By default, containers cannot use NFS. To enable NFS for a container:

  1. log into host
  2. shutdown container: vzctl stop [container id]
  3. enable NFS for container: vzctl set [container id] --features "nfs:on" --save
  4. start container: vzctl start [container id]

Gaining Access to the Ubuntu Container with noVNC Console

  1. SSH into the Proxmox host as root
  2. Type vzctl enter [ID# of container]
  3. Edit /etc/init/tty1.conf such that it looks like this:
                1. # tty1 - getty
                2. #
                3. # This service maintains a getty on tty1 from the point the system is # started until it is shut down again.
                4. start on stopped rc RUNLEVEL=[2345]
                5. stop on runlevel [!2345]
                6. respawn exec /sbin/getty -8 38400 tty1
    1. Restart the container
    2. Use console to log into the container (nothing might show, but just enter root as the username and press enter)

Basic Setup Script

#!/bin/bash

#

#

### Set static ip for eth0 ###

#echo -e "auto eth0

#iface eth0 inet static

# address

# netmask

# network

# gateway

# broadcast " >> /etc/network/interfaces

### Bring up eth0 ###

#ifup eth0

### Set archive mirror ###

echo -e "deb http://mirror.glendaleacademy.org/ubuntu trusty main restricted universe

deb http://mirror.glendaleacademy.org/ubuntu trusty-updates main restricted universe

deb http://mirror.glendaleacademy.org/ubuntu trusty-security main restricted universe multiverse

deb http://mirror.glendaleacademy.org/partner trusty partner" > /etc/apt/sources.list

### Install utilities to make the server easier to use ###

apt-get update

apt-get install man-db sudo dialog nano bsdutils language-pack-en apt-utils -y

### Add admin user (assuming hostname = username) ###

useradd -m $HOSTNAME -G sudo

echo $HOSTNAME:[new password] | chpasswd

chsh -s /bin/bash $HOSTNAME

### Set timezone ###

echo "America/Los_Angeles" | tee /etc/timezone

dpkg-reconfigure --frontend noninteractive tzdata

### Create history file ###

echo "HISTFILE=~/.bash_history" >> ~/.bashrc