Development Stuff for hardware and software configurations
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

154 lines
2.7 KiB

4 years ago
4 years ago
4 years ago
  1. # installing Arch on a VM
  2. This is a basic set of instructions for installing Arch on a virtual machine.
  3. # starting steps
  4. Boot up the latest Arch install disk from PXE or an `iso` file.
  5. Find which disk partition you are installing on. For the purpose of this documentation, the disk is `/dev/vda`, but it may be different.
  6. ```
  7. lsblk
  8. ```
  9. Run parted and make a partition. This is for MBR.
  10. ```
  11. parted /dev/vda
  12. (parted) mklabel msdos
  13. (parted) mkpart p ext4 1M 100%
  14. (parted) quit
  15. ```
  16. Create the filesystem
  17. ```
  18. mkfs.ext4 /dev/vda1
  19. ```
  20. Mount the filesystem.
  21. ```
  22. mount /dev/vda1 /mnt
  23. ```
  24. Edit the mirrorlist
  25. ```
  26. vim /etc/pacman.d/mirrorlist
  27. ```
  28. Add the following line:
  29. ```
  30. Server = http://128.153.145.19/archlinux/$repo/os/$arch
  31. ```
  32. Pacstrap the base system (base is `base` system, `base-devel` is gcc and some build tools, `vim` for editor, `htop` for stuff, `git` for aur, `grub` for bootloader, `go` for `yay` later)
  33. ```
  34. pacstrap /mnt base base-devel vim htop git grub go
  35. ```
  36. Wait.
  37. Stop waiting. Install fstab
  38. ```
  39. genfstab -U /mnt > /mnt/etc/fstab
  40. ```
  41. Chroot
  42. ```
  43. arch-chroot /mnt /bin/bash
  44. ```
  45. Install `grub`.
  46. ```
  47. grub-install /dev/vda
  48. grub-mkconfig -o /boot/grub/grub.cfg
  49. # notice, not /dev/vda1. This is the disk, not the partition.
  50. ```
  51. Set password. Use the VMSSMP for COSI infrastructure.
  52. ```
  53. passwd
  54. ```
  55. Configure networking. Find the network interface. Something with `NO CARRIER` is probably *not* it. It may have an IPv6 global address and perhaps a COSI IPv4 address already.
  56. ```
  57. ip -c a
  58. ```
  59. Change to the `netctl` folder, copy static ethernet example.s
  60. ```
  61. cd /etc/netctl
  62. cp examples/ethernet-static ethernet
  63. ```
  64. Edit the ethernet file.
  65. ```
  66. vim ethernet
  67. ```
  68. Typical contents
  69. ```
  70. Description='A basic statc ethernet connection'
  71. Interface=ens3
  72. Connection=ethernet
  73. IP=static
  74. Address=('128.153.145.23/24')
  75. Gateway='128.153.145.1'
  76. DNS=('128.153.145.3')
  77. ```
  78. Enable that, document IP addresses if on COSI infrastructure.
  79. ```
  80. netctl enable ethernet
  81. ```
  82. Edit hostname
  83. ```
  84. vim /etc/hostname
  85. ```
  86. We're done. Exit and reboot. Remove bootable media if applicable.
  87. ```
  88. exit
  89. reboot
  90. ```
  91. If you screw up, feel free to reboot into the live media, and then you can chroot into the system to fix it after mounting it.
  92. Don't forget to create the `cslabadmin` user. `openssh` server is also probably good - typically the only edits are to enable `Listen 0.0.0.0` and `Port 13699`.
  93. Random commands useful to doing things:
  94. ```
  95. # create user
  96. useradd <username>
  97. # create group
  98. groupadd <group>
  99. # add user to group
  100. gpasswd -a <username> <groupname>
  101. # set default editor to Vim
  102. export EDITOR=vim
  103. # add sudo group to sudoers
  104. visudo
  105. # get and install yay (AUR package manager)
  106. git clone https://aur.archlinux.org/yay.git
  107. cd yay
  108. makepkg -i
  109. ```