Proxmox Ubuntu 14.04 Container
Creating the Ubuntu Container
- Download the Ubuntu 14.04 template from OpenVZ
- Log into Proxmox and upload the template to the appropriate storage location
- Click Create CT
- Create the new container with your desired settings
- Choose the newly uploaded template to use for the container
- When Proxmox reports TASK OK, the container is finished
- Start the container
Using NFS within a Container
By default, containers cannot use NFS. To enable NFS for a container:
- log into host
- shutdown container: vzctl stop [container id]
- enable NFS for container: vzctl set [container id] --features "nfs:on" --save
- start container: vzctl start [container id]
Gaining Access to the Ubuntu Container with noVNC Console
- SSH into the Proxmox host as root
- Type vzctl enter [ID# of container]
- Edit /etc/init/tty1.conf such that it looks like this:
- # tty1 - getty
- #
- # This service maintains a getty on tty1 from the point the system is # started until it is shut down again.
- start on stopped rc RUNLEVEL=[2345]
- stop on runlevel [!2345]
- respawn exec /sbin/getty -8 38400 tty1
- Restart the container
- 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