Advertisement
kiedtink

Instal debian 10 Buster + proxmox v6

Dec 10th, 2017 (edited)
536
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 5.92 KB | None | 0 0
  1. instal debian buster + proxmox 6 (for easy storage and partition in proxmox)
  2. =======================
  3.  
  4. ##### 1. instal debian buster iso minimal, partition : #####
  5.  
  6. /root
  7. swap
  8. /var/lib/vz
  9.  
  10. ## select install :
  11. + ssh server
  12. + standart system utilities
  13.  
  14. ##### 2. Enable root login over SSH: #####
  15. ## As root, edit the sshd_config file in /etc/ssh/sshd_config :
  16.  
  17. nano /etc/ssh/sshd_config.
  18.  
  19. ## Add a line :
  20.  
  21. PermitRootLogin yes
  22.  
  23. ## Save the updated /etc/ssh/sshd_config file. Then restart the SSH server:
  24.  
  25. service sshd restart.
  26.  
  27. ##### 3. remote via ssh, login as root #####
  28.  
  29. ## if temporary want use proxy apt :
  30.  
  31. export http_proxy=http://10.20.30.253:3128
  32.  
  33. ## for remove proxy, edit file in /etc/apt/apt.conf , remove line proxy on there
  34.  
  35. ## change repo indo :
  36.  
  37. nano /etc/apt/sources.list
  38.  
  39. ## disable all line, then add :
  40.  
  41. ###
  42. deb http://mirror.poliwangi.ac.id/debian/ buster main contrib non-free
  43. deb http://mirror.poliwangi.ac.id/debian/ buster-updates main contrib non-free
  44. deb http://mirror.poliwangi.ac.id/debian-security/ buster/updates main contrib non-free
  45. ###
  46.  
  47. ## add repo proxmox :
  48.  
  49. echo "deb http://download.proxmox.com/debian/pve buster pve-no-subscription" > /etc/apt/sources.list.d/pve-install-repo.list
  50. wget http://download.proxmox.com/debian/proxmox-ve-release-6.x.gpg -O /etc/apt/trusted.gpg.d/proxmox-ve-release-6.x.gpg
  51. chmod +r /etc/apt/trusted.gpg.d/proxmox-ve-release-6.x.gpg
  52.  
  53. ## If use AMD Carizo proci,
  54.  
  55. apt remove pve-firmware proxmox-ve
  56. apt remove firmware-amd-graphics
  57.  
  58. ## install some package tools
  59. apt update && apt install net-tools mlocate ntfs-3g lshw samba cifs-utils build-essential intel-microcode -y
  60.  
  61. ## install proxmox
  62. apt dist-upgrade
  63. apt install proxmox-ve postfix open-iscsi
  64.  
  65. ## Instal firmware rtl nic if needed
  66. apt install firmware-linux-nonfree
  67. apt remove os-prober
  68. reboot
  69.  
  70. ### add sensor cpu temperature on webfig
  71. see : https://www.gaoxiaobo.com/web/server/69.html
  72.  
  73. ## remove kernel debian if needed
  74. apt remove linux-image-amd64 linux-image-4.*.*-*-amd64
  75. update-grub
  76.  
  77. ##### 4a. If need add disk ntfs to host : #####
  78.  
  79. blkid
  80. mkdir /mnt/windows
  81. mount -t ntfs-3g /dev/sdc1 /mnt/windows
  82.  
  83. ## auto mount via /etc/fstab
  84.  
  85. blkid
  86.  
  87. # /dev/sdb5: LABEL="BACKUP" UUID="01D0AD16CA0C16A0" TYPE="ntfs" PARTUUID="60db9826-05"
  88.  
  89. # add line to /etc/fstab
  90.  
  91. UUID=01D0AD16CA0C16A0 /mnt/windows ntfs-3g defaults 0 0
  92.  
  93. ##### 4b. Mount host folder to container lxc
  94.  
  95. # edit /etc/pve/nodes/data/lxc/xxx.conf , ten add line
  96.  
  97. lxc.mount.entry: /storage/share/share storage/share none bind,create=dir,optional 0 0
  98.  
  99. ##### 5. If need add disk passtrough vm #####
  100.  
  101. ls -l /dev/disk/by-id | grep ata-
  102. # lrwxrwxrwx 1 root root  9 Dec 22 05:04 ata-ST1000DM010-2DM162_Z4YFAQ56 -> ../../sdc
  103.  
  104. ## add to kvm (100 is ID VM, ata-xxx is name from ls):
  105.  
  106. qm set 100 -virtio3 /dev/disk/by-id/ata-ST1000DM010-2DM162_Z4YFAQ56
  107. update VM 100: -virtio3 /dev/disk/by-id/ata-ST1000DM010-2DM162_Z4YFAQ56
  108.  
  109. # OR, edit manual from /etc/pve/nodes/proxmox/qemu-server/***.conf
  110.  
  111. ##### 6. if need mount samba from other pc as storage directory, or from vm share to host #####
  112. ## assumed samba server is //data/share , can be //IP_Address/share
  113.  
  114. mkdir /storage/samba
  115. mount -t cifs //10.20.30.200/MOVIE-OP /home/user/server/movie/ -o guest,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm
  116.  
  117. # OR
  118. mount -t cifs -o vers=3,username=none,password=none '\\10.20.30.200\MOVIE-OP\movie1' /mnt
  119.  
  120. ## auto mount via /etc/fstab
  121. //10.20.30.200/MOVIE-OP /home/user/server/movie/ cifs guest,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm 0 0
  122.  
  123. ###### 7. Add audio to vm
  124. # ADD this line to /etc/pve/nodes/proxmox/qemu-server/***.conf
  125.  
  126. args: -device AC97,addr=0x18
  127.  
  128. # or
  129.  
  130. args: -device intel-hda,id=sound5,bus=pci.0,addr=0x18 -device hda-micro,id=sound5-codec0,bus=sound5.0,cad=0 -device hda-duplex,id=sound5-codec1,bus=sound5.0,cad=1
  131.  
  132. ###### 8. Networking config /etc/network/interfaces #####
  133.  
  134. auto lo
  135. iface lo inet loopback
  136.  
  137. allow-hotplug enp2s0
  138.  
  139. auto enp2s0
  140. iface enp2s0 inet manual
  141.         dns-nameservers 10.20.30.99
  142.         dns-search amanah.biz
  143. # dns-* options are implemented by the resolvconf package, if installed
  144.  
  145. auto vmbr0
  146. # bridge nic enp2s0
  147. iface vmbr0 inet static
  148.         address  10.20.30.234
  149.         netmask  255.255.255.0
  150.         gateway  10.20.30.99
  151.         bridge_ports enp2s0
  152.         bridge_stp off
  153.         bridge_fd 0
  154.  
  155. auto vmbr1
  156. #private sub network
  157. iface vmbr1 inet static
  158.         address  10.10.10.1
  159.         netmask  255.255.255.0
  160.         bridge_ports none
  161.         bridge_stp off
  162.         bridge_fd 0
  163.  
  164.         post-up echo 1 > /proc/sys/net/ipv4/ip_forward
  165.         post-up   iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE
  166.         post-up   iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o enp2s0 -j MASQUERADE
  167.  
  168.         post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o vmbr0 -j MASQUERADE
  169.         post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o enp2s0 -j MASQUERADE
  170.  
  171. ### 8. Set debian as gateway
  172.  
  173. nano /etc/sysctl.conf
  174.  
  175. # uncomment line bellow
  176. net.ipv4.ip_forward=1
  177.  
  178. # create nat iptables to rc.local
  179. iptables -t nat -A POSTROUTING -o enps0 -j MASQUERADE
  180.  
  181. ### 9. sample samba config, see :  https://pastebin.com/NMvjhmxD
  182.  
  183. nano /etc/security/limits.conf
  184.  
  185. And add at the end:
  186.  
  187. * - nofile 16384
  188. root - nofile 16384
  189. ############################################
  190.  
  191. ## 10. if need debian desktop :
  192.  
  193. apt-get install lxde xorg chromium synaptic --no-install-recommends
  194.  
  195. ## auto login :
  196.  
  197. nano /etc/lightdm/lightdm.conf
  198.  
  199. [Seat:*]
  200. autologin-user=user
  201.  
  202. ## for root login
  203. nano /etc/pam.d/lightdm-autologin
  204.  
  205.   change:
  206.     auth      required pam_succeed_if.so user != root quiet_success
  207.   to:
  208.     auth      required pam_succeed_if.so user != anything quiet_success
  209.  
  210. ## 10. FINISH
  211.  
  212. Extra :
  213. https://nubcakes.net/index.php/2019/03/05/how-to-add-storage-to-proxmox/
  214. https://www.cyberciti.biz/faq/linux-list-network-cards-command/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement