]> git.donarmstrong.com Git - neurodebian.git/blob - sphinx/vm.rst
Few more notes on the VM (not yet done).
[neurodebian.git] / sphinx / vm.rst
1 Standard Debian install
2
3 hostname: neurodebian
4 domain: ''
5
6 all file in one partition
7
8 root: not there
9 user: brain
10 pwd: neurodebian
11
12
13 Do a minimal install
14 --------------------
15
16 All files in one partition/
17 just base system, run selection, but no tasks (not even 'Standard system')
18
19
20 install new stuff
21 -----------------
22
23 Add sources.list for backports and neurodebian
24 wget -O /etc/apt/sources.list.d/neuro.debian.net.list http://neuro.debian.net/_static/neurodebian.lenny.us.sources.list
25 echo "deb http://www.backports.org/debian lenny-backports main contrib non-free" >> /etc/apt/sources.list.d/backports.org.list
26 wget -O - http://backports.org/debian/archive.key | apt-key add -
27 wget -O - http://neuro.debian.net/_static/neuro.debian.net.asc | apt-key add -
28
29 install kernel 2.6.27 (or later) from backports to have support for OpenGL
30 direct rendering in VirtualBox
31 (and deinstall the old one, after a successfull reboot)
32
33 # a basic desktop
34 aptitude install \
35  alacarte desktop-base evince file-roller gcalctool gdm gksu gnome-core
36  gnome-keyring gnome-utils gnome-volume-manager gnome-mount gthumb
37  bash-completion less mc gnome-themes etckeeper git-core gitk ntpdate
38
39 # cleanup unwanted stuff
40 # video drivers (all but vesa)
41 aptitude purge $(apt-cache search --names-only --installed xserver-xorg-video | grep xserver-xorg-video | cut -d ' ' -f 1,1) xserver-xorg-video-vesa+
42 # random stuff
43 aptitude purge radeontool sound-juicer
44
45 # setup etckeeper
46 etckeeper init
47
48 # prepare for kernel module building (guest additions)
49 aptitude install module-assistant
50 module-assistant prepare
51 bash /media/cdrom/VBoxLinuxAdditions-amd64.run (need 2.6.27+ kernel for direct rendering)
52
53 #make sure that xorg.conf has 'vboxvideo' as device driver and also
54 echo "vboxvideo" >> /etc/modules
55
56 # make user brain allowed to execute sudo without a password
57 adduser brain sudo
58 visudo
59 # and uncomment the respective line at the end of the file
60 # (make sure there is nothing below it)
61
62 # configure shared folders
63 mkdir /mnt/host
64 mount -t vboxsf host /mnt/host
65 # better put the following into the session startup config of the user
66 sudo mount -t vboxsf -o defaults,uid=brain,gid=brain host /mnt/host
67
68
69 # neuro-stuff
70 aptitude install afni afni-atlases amide caret dicomnifti fsl fsl-atlases lipsia
71  minc-tools odin psychopy python-mvpa python-pyepl
72
73 # general scientifically useful stuff
74 aptitude install ipython python-h5py
75
76
77 user config
78 -----------
79 # put use home dir in git to be able to track changes
80 git init
81
82 mkdir -p /home/brain/.config/backgrounds
83 cp /mnt/host/.config/awesome/hotbrain.png /home/brain/.config/backgrounds/
84
85 #change menu icon
86 sudo cp /mnt/host/hacking/neurodebian/artwork/icon.svg /usr/share/icons/Mist/scalable/places/start-here.svg
87
88
89 Deploy
90 ------
91
92 # shrink VDI image by writting to a new (unfragmented) image
93 # target VDI needs to have proper partition table and MBR
94
95 # clone HDD
96 #dd if=dev/hda of=/dev/hdb bs=512 count=1
97 # fixing bits extended partition is empty -> create swap partition
98 #fdisk /dev/hdb
99 #mkswap /dev/hdb5
100 #mkfs.ext3 -m 1 /dev/hdb1
101 #tune2fs -c 100 /dev/hdb1
102
103
104 cd /tmp
105 cp /home/neurodebian/vm/nd_plainpartition.vdi nd_hdd.vdi
106 mkdir -p vbdev/src vbdev/dest vbmnt/src vbmnt/dest
107
108 # get access to disks inside the VDIs
109 sudo vdfuse -f /home/neurodebian/vm/nd_master.vdi vbdev/src/
110 sudo vdfuse -f nd_hdd.vdi vbdev/dest/
111
112
113
114 # mount partititions
115 sudo mount -o loop vbdev/src/Partition1 vbmnt/src
116 sudo mount -o loop vbdev/dest/Partition1 vbmnt/dest
117
118 # now extract files from src, filter, and move to dest
119 sudo rsync -xaHD --delete \
120   --exclude=dev \
121   --exclude=proc \
122   --exclude=tmp \
123   --exclude=var/cache/apt \
124   --exclude=var/log/* \
125   --exclude=etc/.git \
126   --exclude=home/brain/.git \
127   --exclude=var/lib/apt/lists \
128   vbmnt/src/ vbmnt/dest/
129
130 sudo umount vbmnt/dest
131 sudo umount vbmnt/src
132 sudo umount vbdev/dest
133 sudo umount vbdev/src
134