{"id":181807,"date":"2020-05-13T09:45:24","date_gmt":"2020-05-13T01:45:24","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=181807"},"modified":"2020-06-13T17:52:22","modified_gmt":"2020-06-13T09:52:22","slug":"vm-install-archlinux","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/vm-install-archlinux.html","title":{"rendered":"\u865a\u62df\u673a\u4e2d\u5982\u4f55\u5b89\u88c5Arch Linux\u64cd\u4f5c\u7cfb\u7edf"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nArch Linux\u662f\u4e00\u4e2a\u901a\u7528\u7684\u6eda\u52a8\u53d1\u884c\u7248Linux\uff0c\u4e00\u65e6\u7cfb\u7edf\u6216\u8005\u8f6f\u4ef6\u6709\u65b0\u7248\u672c\u53d1\u5e03\uff0c\u4f60\u5c31\u53ef\u4ee5\u5347\u7ea7\u5b83\u4eec\u3002\u6df1\u53d7DIY\u7231\u597d\u8005\u548cLinux\u6838\u5fc3\u7528\u6237\u7684\u6b22\u8fce\u3002\u9ed8\u8ba4\u5b89\u88c5\u53ea\u8986\u76d6\u6700\u5c0f\u7684\u57fa\u672c\u7cfb\u7edf\uff0c\u5e76\u5e0c\u671b\u7528\u6237\u81ea\u884c\u914d\u7f6e\u7cfb\u7edf\u3002\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u5b89\u88c5Arch Linux\u672c\u8eab\u5c31\u662f\u4e00\u4e2a\u6311\u6218\uff0c\u4f46\u540c\u65f6\uff0c\u5b83\u4e5f\u662f\u4e2d\u7ea7Linux\u7528\u6237\u7684\u4e00\u4e2a\u5b66\u4e60\u673a\u4f1a\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\u73af\u5883<\/strong><\/div>\n

VMware Workstation 15.0<\/p>\n

Arch Linux 2020.05<\/p>\n

\u5982\u4f55\u4e0b\u8f7dArchLinux<\/strong><\/span><\/div>\n

\u67e5\u770b\u6700\u65b0\u7248\u672c\u7684\u7cfb\u7edf\uff1ahttp:\/\/mirrors.163.com\/archlinux\/iso\/latest\/<\/a><\/p>\n

\u4e0b\u8f7d\u5730\u5740\uff1ahttp:\/\/mirrors.163.com\/archlinux\/iso\/latest\/archlinux-2020.05.01-x86_64.iso<\/a><\/p>\n

\"\"<\/p>\n

\u521b\u5efaArch Linux\u865a\u62df\u673a<\/strong><\/span><\/div>\n

\u865a\u62df\u673a\u7684\u7248\u672c\u53ef\u4ee5\u9009\u62e9\u201c\u5176\u4ed6\u2026\u201d
\n\"\"<\/p>\n

\u5b89\u88c5\u64cd\u4f5c\u7cfb\u7edf<\/strong><\/div>\n

\u5f15\u5bfc\u754c\u9762\uff0c\u9009\u62e9\u7b2c\u4e00\u9879
\n\"\"
\n\u542f\u52a8\u4e4b\u540e\uff0c\u53ef\u4ee5\u770b\u5230\uff0c\u8fdb\u5165\u4e86Live\u73af\u5883\u3002
\n\"\"<\/p>\n

\u68c0\u67e5\u4e00\u4e0b\u662f\u5426\u8fde\u63a5\u5230\u56e0\u7279\u7f51<\/strong><\/span><\/div>\n

\u68c0\u67e5\u4e00\u4e0b\u7f51\u5361\u662f\u5426\u83b7\u53d6\u5230IP\u5730\u5740\u4e86\uff1a<\/p>\n

\r\nroot@archiso ~ # ip ad                                                                           \r\n1: lo:  mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000\r\n    link\/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00\r\n    inet 127.0.0.1\/8 scope host lo\r\n       valid_lft forever preferred_lft forever\r\n    inet6 ::1\/128 scope host \r\n       valid_lft forever preferred_lft forever\r\n2: ens33:  mtu 1500 qdisc fq_codel state UP group default qlen 1000\r\n    link\/ether 00:0c:29:83:ed:00 brd ff:ff:ff:ff:ff:ff\r\n    altname enp2s1\r\n    inet 192.168.43.154\/24 brd 192.168.43.255 scope global dynamic noprefixroute ens33\r\n       valid_lft 1706sec preferred_lft 1481sec\r\n    inet6 fe80::456b:5cf2:4baa:efd8\/64 scope link \r\n       valid_lft forever preferred_lft forever\r\n<\/pre>\n

\u7136\u540eping\u4e00\u4e0b\u5916\u90e8\u7f51\u7edc\u8bd5\u8bd5\uff0c\u80fd\u5426\u4e0a\u7f51\uff1a<\/p>\n

\r\nroot@archiso ~ # ping www.baidu.com\r\nPING www.a.shifen.com (180.101.49.12) 56(84) bytes of data.\r\n64 bytes from 180.101.49.12 (180.101.49.12): icmp_seq=1 ttl=128 time=20.3 ms\r\n64 bytes from 180.101.49.12 (180.101.49.12): icmp_seq=2 ttl=128 time=20.5 ms\r\n^C\r\n--- www.a.shifen.com ping statistics ---\r\n2 packets transmitted, 2 received, 0% packet loss, time 1001ms\r\nrtt min\/avg\/max\/mdev = 20.252\/20.391\/20.531\/0.139 ms\r\n<\/pre>\n

\u5982\u679c\u53ef\u4ee5\u4e0a\u7f51\uff0c\u5c31\u8fdb\u884c\u4e0b\u4e00\u6b65\u5427\uff01<\/p>\n

\u521b\u5efa\u5206\u533a<\/strong><\/span><\/div>\n

\u5728\u8fd9\u91cc\u6211\u4eec\u5206\u4e24\u4e2a\u533a\uff0c\u5206\u522b\u4e3a\uff1a<\/p>\n

    \n
  • swap \uff1a512MB<\/li>\n
  • \/ \uff1a\u5269\u4f59\u6240\u6709\u7a7a\u95f4<\/li>\n<\/ul>\n

    sda\u78c1\u76d8\u603b\u5bb9\u91cf\u4e3a20GB\u3002<\/p>\n

    \r\nroot@archiso ~ # fdisk -l\r\n<\/pre>\n

    \"\"
    \n\u521b\u5efa\u5206\u533a\uff1a
    \n\"\"<\/p>\n

    \u683c\u5f0f\u5316\u5206\u533a\uff0c\u5e76\u6302\u8f7d\u5206\u533a<\/strong><\/span><\/div>\n

    \/dev\/sda1\u5206\u533a\uff0c\u521b\u5efaswap\u5206\u533a\uff0c\u5e76\u4e14\u542f\u7528\u3002<\/p>\n

    \r\nroot@archiso ~ # mkswap \/dev\/sda1\r\nSetting up swapspace version 1, size = 488 MiB (511700992 bytes)\r\nno label, UUID=ee7fa952-a403-4b6e-9b15-fddc21246fc3\r\nroot@archiso ~ # swapon \/dev\/sda1\r\n<\/pre>\n

    \"\"
    \n\u683c\u5f0f\u5316sda2\u5206\u533a\u4e3axfs\u6587\u4ef6\u7cfb\u7edf\uff0c\u5e76\u4e14\u6302\u8f7d\u5206\u533a\u5230\/mnt\u76ee\u5f55\uff1a<\/p>\n

    \r\nroot@archiso ~ # mkfs.xfs \/dev\/sda2\r\nroot@archiso ~ # mount \/dev\/sda2 \/mnt\r\n<\/pre>\n

    \"\"<\/p>\n

    \u4fee\u6539\u955c\u50cf\u6e90<\/strong><\/span><\/div>\n

    \u8fdb\u5165\/etc\/pacman.d<\/code>\u76ee\u5f55\uff0c\u4fee\u6539mirrorlist<\/code>\u6587\u4ef6\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cmirrorlist\u6587\u4ef6\u91cc\u9762\u5305\u542b\u4e86\u8bb8\u591a\u6e90\u5730\u5740\uff0c\u8fd9\u6837\u4f1a\u5bfc\u81f4\u4e0b\u8f7d\u7a0b\u5e8f\u5305\u901f\u5ea6\u5f88\u6162\uff0c\u6211\u4eec\u53ea\u9700\u8981\u542f\u7528\u4e2d\u56fd\u7684\u6e90\u5730\u5740\u5c31\u53ef\u4ee5\uff1a<\/p>\n

    \r\nroot@archiso ~ # cd \/etc\/pacman.d \r\nroot@archiso \/etc\/pacman.d # ll\r\ntotal 25\r\ndrwxr-xr-x 4 root root   320 May  6  2020 gnupg\r\n-rw-r--r-- 1 root root   495 May  6  2020 mirrorlist\r\nroot@archiso \/etc\/pacman.d # mv mirrorlist mirrorlist.back\r\nroot@archiso \/etc\/pacman.d # cat mirrorlist.back | grep -A1 China | grep -v '\\-' > mirrorlist\r\n<\/pre>\n

    \"\"<\/p>\n

    \u5b89\u88c5\u5fc5\u987b\u8f6f\u4ef6\u5305<\/strong><\/span><\/div>\n
    \r\nroot@archiso ~ # pacstrap \/mnt base linux linux-firmware dhcpcd vim openssh xfsprogs man net-tools\r\n<\/pre>\n
    \u751f\u6210fstab\u6587\u4ef6<\/strong><\/span><\/div>\n

    \u4f7f\u7528genfstab\u547d\u4ee4\u751f\u6210\u914d\u7f6e\u6587\u4ef6\u3002-U<\/code>\u547d\u4ee4\u7528\u6765\u8bbe\u7f6eUUID\u3002<\/p>\n

    \r\nroot@archiso ~ # genfstab -U \/mnt >> \/mnt\/etc\/fstab                                                                      \r\nroot@archiso ~ # cat !$\r\ncat \/mnt\/etc\/fstab\r\n# Static information about the filesystems.\r\n# See fstab(5) for details.\r\n\r\n# <file system> <dir> <type> <options> <dump> <pass>\r\n# \/dev\/sda2\r\nUUID=ed6bd242-34fe-43b6-bb0a-08af6cdb28e8\t\/         \txfs       \trw,relatime,attr2,inode64,logbufs=8,logbsize=32k,noquota\t0 1\r\n\r\n# \/dev\/sda1\r\nUUID=ee7fa952-a403-4b6e-9b15-fddc21246fc3\tnone      \tswap      \tdefaults  \t0 0\r\nroot@archiso ~ #\r\n<\/pre>\n

    \u53ef\u4ee5\u770b\u5230swap\u5206\u533a\u548c\/\u5206\u533a\u90fd\u5df2\u7ecf\u5199\u5165fstab\u914d\u7f6e\u6587\u4ef6\u4e86\u3002<\/p>\n

    \u66f4\u6539\u6839\u76ee\u5f55<\/strong><\/span><\/div>\n
    \r\nroot@archiso ~ # arch-chroot \/mnt                                                                                    \r\n[root@archiso \/]#\r\n<\/pre>\n
    \u66f4\u6539\u65f6\u533a<\/strong><\/span><\/div>\n

    \u66f4\u6539\u65f6\u533a\u4e3a\u4e9a\u6d32\u3001\u4e0a\u6d77\u3002\u5e76\u540c\u6b65\u65f6\u95f4\u5230\u786c\u4ef6\u65f6\u95f4\u3002<\/p>\n

    \r\n[root@archiso \/]# ln -sf \/usr\/share\/zoneinfo\/Asia\/Shanghai \/etc\/localtime\r\n[root@archiso \/]# hwclock -w\r\n<\/pre>\n
    \u8bbe\u7f6e\u672c\u5730\u5316\u6587\u672c\u7f16\u7801<\/strong><\/span><\/div>\n

    \u7f16\u8f91\/etc\/locale.gen<\/code>\u6dfb\u52a0\u5982\u4e0b\u5185\u5bb9\uff1a<\/p>\n

    \r\n[root@archiso \/]# echo \u201cen_US.UTF-8 UTF-8\u201d >> \/etc\/locale.gen\r\n[root@archiso \/]# echo LANG=en_US.UTF-8 > \/etc\/locale.conf\r\n<\/pre>\n
    \u8bbe\u7f6eroot\u5bc6\u7801<\/strong><\/span><\/div>\n
    \r\n[root@Archone \/]# passwd root\r\nNew password: \r\nRetype new password: \r\npasswd: password updated successfully\r\n[root@Archone \/]#\r\n<\/pre>\n
    \u8bbe\u7f6e\u5f00\u673a\u542f\u52a8\u9879<\/strong><\/span><\/div>\n
    \r\n[root@Archone \/]# systemctl enable dhcpcd\r\n[root@Archone \/]# systemctl enable sshd\r\n<\/pre>\n
    \u5b89\u88c5\u5e76\u914d\u7f6egrub2\u5f15\u5bfc<\/strong><\/span><\/div>\n

    \u5b89\u88c5grub2<\/p>\n

    \r\n[root@Archone \/]# pacman -S grub \u2013noconfirm\r\n[root@Archone \/]# grub-install \/dev\/sda\r\nInstalling for i386-pc platform.\r\nInstallation finished. No error reported.\r\n<\/pre>\n

    \u5bfc\u51fagrub\u914d\u7f6e\u6587\u4ef6\u5230\/boot\/grub\/grub.cfg<\/code><\/p>\n

    \r\n[root@Archone \/]# grub-mkconfig -o \/boot\/grub\/grub.cfg\r\n<\/pre>\n
    \u914d\u7f6e\u5b8c\u6210<\/strong><\/span><\/div>\n

    \u91cd\u542f\u7cfb\u7edf<\/p>\n

    \r\n[root@Archone \/]# exit\r\nroot@archiso ~ # reboot\r\n<\/pre>\n

    \u53ef\u4ee5\u770b\u5230\uff0c\u91cd\u542f\u4e4b\u540e\u5df2\u7ecf\u8fdb\u5165\u7cfb\u7edf\u4e86\u3002
    \n\"\"<\/p>\n

    \u4fee\u6539ssh\u914d\u7f6e\u6587\u4ef6\uff0c\u5141\u8bb8root\u7528\u6237ssh\u767b\u5f55<\/strong><\/span><\/div>\n

    \u53d1\u73b0\u4f7f\u7528root\u7528\u6237\u4e0d\u80fdssh\u8fdc\u7a0b\u767b\u5f55\u7cfb\u7edf\uff0c\u662f\u56e0\u4e3a\u914d\u7f6e\u6587\u4ef6\u91cc\u9762\u6ca1\u6709\u5141\u8bb8root\u7528\u6237\u767b\u5f55\uff1a<\/p>\n

    \r\n[root@arch-one ~]# sed -i 's\/#PermitRootLogin prohibit-password\/PermitRootLogin yes\/g' \/etc\/ssh\/sshd_config\r\n[root@arch-one ~]# systemctl restart sshd\r\n<\/pre>\n

    \u8fd9\u6837\u5c31\u53ef\u4ee5ssh\u8fdc\u7a0b\u767b\u5f55\u670d\u52a1\u5668\u4e86\u3002<\/p>\n

    \u5b89\u88c5Gnome\u684c\u9762\u73af\u5883<\/strong><\/div>\n
    \r\n# \u5b89\u88c5\u63d0\u793a\u4fe1\u606f\uff0c\u9ed8\u8ba4\u90fd\u56de\u8f66\u5373\u53ef\u3002\r\n[root@arch-one ~]# pacman -S xorg xorg-server gnome\r\n[root@arch-one ~]# systemctl enable gdm NetworkManager\r\nCreated symlink \/etc\/systemd\/system\/display-manager.service -> \/usr\/lib\/systemd\/system\/gdm.service.\r\nCreated symlink \/etc\/systemd\/system\/multi-user.target.wants\/NetworkManager.service -> \/usr\/lib\/systemd\/system\/NetworkManager.service.\r\nCreated symlink \/etc\/systemd\/system\/dbus-org.freedesktop.nm-dispatcher.service -> \/usr\/lib\/systemd\/system\/NetworkManager-dispatcher.service.\r\nCreated symlink \/etc\/systemd\/system\/network-online.target.wants\/NetworkManager-wait-online.service -> \/usr\/lib\/systemd\/system\/NetworkManager-wait-online.service.\r\n<\/pre>\n

    \u91cd\u542f\u64cd\u4f5c\u7cfb\u7edf<\/p>\n

    \r\n[root@arch-one ~]# reboot\r\n<\/pre>\n

    \"\"<\/p>\n

    \"\"<\/p>\n

    \u603b\u7ed3<\/strong><\/div>\n

    \u4f60\u53ef\u80fd\u5df2\u7ecf\u610f\u8bc6\u5230\u5b89\u88c5Arch Linux\u5e76\u4e0d\u50cf\u5b89\u88c5Ubuntu\u90a3\u4e48\u5bb9\u6613\u3002\u7136\u800c\uff0c\u53ea\u8981\u6709\u4e00\u70b9\u8010\u5fc3\uff0c\u4f60\u5c31\u4e00\u5b9a\u53ef\u4ee5\u5b8c\u6210\u5b83\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

    VMware Workstation 15.0 Arch Linux 2020.05 \u67e5\u770b\u6700\u65b0\u7248\u672c\u7684\u7cfb\u7edf\uff1aht […]<\/p>\n","protected":false},"author":309,"featured_media":181808,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-181807","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/181807","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/309"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=181807"}],"version-history":[{"count":9,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/181807\/revisions"}],"predecessor-version":[{"id":193884,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/181807\/revisions\/193884"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/181808"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=181807"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=181807"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=181807"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}