This is an old revision of the document!

Recipe for Mike Radio Container

LXC Container - Debian 9

  • Create CT: debian 9.4 lxc template, 4 cpu limit, 20 gb hdd, 1024 mb ram, 512 mb swap
  • enable fuse container (see<code> echo $'lxc.autodev: 1\nlxc.hook.autodev: sh -c “mknod -m 0666 ${LXC_ROOTFS_MOUNT}/dev/fuse c 10 229”' » /etc/pve/lxc/###.conf </code>
  • add mounts of old container to new container e.g. pct set 106 --mp0 ssd160gbthin:vm-106-disk-1,mp=/mnt/old
  • pct start 206 && pct enter 206
  • …in the container…
  • reset the root password (since proxmox sets it using an older, less-secure hashing algorithm): passwd
  • migrate users:
    tail -n4 /mnt/old/etc/passwd | head -n2 >> /etc/passwd
    tail -n4 /mnt/old/etc/shadow | head -n2 >> /etc/shadow
  • migrate groups:
    tail -n3 /mnt/old/etc/group | head -n2 >> /etc/group
    tail -n3 /mnt/old/etc/gshadow | head -n2 >> /etc/gshadow
  • use console:
    adduser tdobes adm
    adduser tdobes systemd-journal
    adduser tdobes staff
    adduser mike staff

    …now you can ssh in

  • sed -i -e 's/"syntax on/syntax on/g' -e 's/"set background=dark/set background=dark/g' -e 's/"set showcmd/set showcmd/g' -e 's/"set showmatch/set showmatch/g' -e 's/"set ignorecase/set ignorecase/g' -e 's/"set smartcase/set smartcase/g' -e 's/"set incsearch/set incsearch/g' -e 's/"set autowrite/set autowrite/g' -e 's/"set hidden/set hidden/g' -e 's/"set mouse=a/set mouse=nic/g' /etc/vim/vimrc
  • vi /etc/vim/vimrc # – and uncomment autocmd block for jumping to last position
  • aptitude update && aptitude forget-new && aptitude full-upgrade
  • aptitude install icecast mpd mpc ncmpc
  • migrate ssh keys: cp -a /mnt/old/etc/ssh/ssh_host_*key* /etc/ssh/
  • migrate homes: rsync -aix --del /mnt/old/home/ /home/
computer/mike_radio_container_recipe.1529427972.txt.gz · Last modified: 2018/06/19 12:06 by tdobes
Recent changes RSS feed Driven by DokuWiki Valid XHTML 1.0 Valid CSS