{"id":28858,"date":"2023-12-22T06:43:26","date_gmt":"2023-10-27T16:53:13","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%b7%b1%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aa%e5%b9%b2%e5%87%80%e7%9a%84centos7%e7%9a%84box%ef%bc%88centos-7-1708%e7%89%88%e6%9c%ac%ef%bc%89%e3%80%82-2\/"},"modified":"2025-08-12T10:29:04","modified_gmt":"2025-08-12T02:29:04","slug":"%e8%87%aa%e5%b7%b1%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aa%e5%b9%b2%e5%87%80%e7%9a%84centos7%e7%9a%84box%ef%bc%88centos-7-1708%e7%89%88%e6%9c%ac%ef%bc%89%e3%80%82-2","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%b7%b1%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aa%e5%b9%b2%e5%87%80%e7%9a%84centos7%e7%9a%84box%ef%bc%88centos-7-1708%e7%89%88%e6%9c%ac%ef%bc%89%e3%80%82-2\/","title":{"rendered":"\u81ea\u5df1\u5236\u4f5c\u4e00\u4e2a\u5e72\u51c0\u7684CentOS7\u7684box\uff08CentOS-7-1708\u7248\u672c\uff09"},"content":{"rendered":"<h2>\u9996\u5148<\/h2>\n<p>\u6211\u4eec\u6b63\u5728\u5c06\u6d41\u7a0b\u4f18\u5316\u5f97\u6bd4\u4ee5\u524d\u66f4\u597d\u3002<\/p>\n<p>\u5236\u4f5cCentOS7\u6f02\u4eae\u7684box\u5907\u5fd8\u5f55\uff08CentOS-7-1708\u7248\uff09\u3002\u4e0d\u8fdb\u884cyum update\u64cd\u4f5c\uff0c\u4fdd\u6301\u4eceISO\u6620\u50cf\u5b89\u88c5\u7684\u6e05\u6d01\u72b6\u6001\u3002\u8bf7\u6839\u636e\u4e2a\u4eba\u559c\u597d\u8fdb\u884c\u5b9a\u5236\u3002<\/p>\n<h2>\u9884\u5148\u51c6\u5907<\/h2>\n<p>\u8bf7\u786e\u4fdd\u4e0b\u5217\u51c6\u5907\u5de5\u4f5c\u5df2\u5b8c\u6210\u3002\u5982\u679c\u4e0d\u6e05\u695a\u53ef\u4ee5\u5411\u8c37\u6b4c\u8001\u5e08\u8be2\u95ee\u3002<\/p>\n<p>1. \u5df2\u7ecf\u5b89\u88c5\u4e86VirtualBox\u3002<br \/>\n2. \u5df2\u7ecf\u8bbe\u7f6e\u597d\u4e86vagrant\u3002<br \/>\n3. \u5df2\u7ecf\u4e0b\u8f7d\u4e86CentsOS7\u7684Minimal ISO\uff08\u672c\u6b21\u51c6\u5907\u4f7f\u7528CentOS-7-x86_64-Minimal-1708.iso\uff09\u3002<\/p>\n<h2>\u521b\u5efa\u865a\u62df\u673a<\/h2>\n<p>\u4f7f\u7528VirtualBox\u521b\u5efa\u57fa\u7840\u865a\u62df\u673a\u3002<\/p>\n<p>\u4ece\u83dc\u5355\u4e2d\u9009\u62e9\u201c\u865a\u62df\u673a\u201d-&gt;\u201c\u65b0\u5efa\u201d\u3002<\/p>\n<p>\u8bf7\u8f93\u5165\u59d3\u540d\u3001\u64cd\u4f5c\u7cfb\u7edf\u3001\u5185\u5b58\u5927\u5c0f\u548c\u786c\u76d8\u5185\u5bb9\uff0c\u7136\u540e\u70b9\u51fb\u521b\u5efa\u6309\u94ae\u3002<\/p>\n<div>\n<div class=\"post-table\">\u9805\u76ee\u8a2d\u5b9a\u5185\u5bb9\u540d\u524dvagrant-centos-7-x86_64-minimal-1708\u30bf\u30a4\u30d7Linux\u30d0\u30fc\u30b8\u30e7\u30f3Red Hat (64-bit)\u30e1\u30e2\u30ea\u30fc\u30b5\u30a4\u30ba1024MB\u30cf\u30fc\u30c9\u30c7\u30a3\u30b9\u30af\u4eee\u60f3\u30cf\u30fc\u30c9\u30c7\u30a3\u30b9\u30af\u3092\u4f5c\u6210\u3059\u308b<\/div>\n<\/div>\n<p>\u53ea\u6709\u5728\u6709512M\u5185\u5b58\u7684\u60c5\u51b5\u4e0b\uff0c\u624d\u80fd\u521b\u5efaSWAP\u533a\u57df\u5e76\u5b8c\u6210\u5b89\u88c5\u3002<\/p>\n<p>\u5728\u8f93\u5165\u6846\u4e2d\u586b\u5165\u6587\u4ef6\u4f4d\u7f6e\u3001\u6587\u4ef6\u5927\u5c0f\u3001\u786c\u76d8\u6587\u4ef6\u7c7b\u578b\u4ee5\u53ca\u7269\u7406\u786c\u76d8\u4e0a\u5b58\u50a8\u7684\u5185\u5bb9\uff0c\u5e76\u70b9\u51fb\u521b\u5efa\u6309\u94ae\u3002<\/p>\n<div>\n<div class=\"post-table\">\u9805\u76ee\u8a2d\u5b9a\u5185\u5bb9\u30d5\u30a1\u30a4\u30eb\u306e\u5834\u6240vagrant-centos-7-x86_64-minimal-1708\u3000\u203b\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u306e\u307e\u307e\u30d5\u30a1\u30a4\u30eb\u30b5\u30a4\u30ba64.00GB\u30cf\u30fc\u30c9\u30c7\u30a3\u30b9\u30af\u306e\u30d5\u30a1\u30a4\u30eb\u30bf\u30a4\u30d7VDI (VirtualBox Disk Image)\u7269\u7406\u30cf\u30fc\u30c9\u30c7\u30a3\u30b9\u30af\u306b\u3042\u308b\u30b9\u30c8\u30ec\u30fc\u30b8\u53ef\u5909\u30b5\u30a4\u30ba<\/div>\n<\/div>\n<h2>\u865a\u62df\u673a\u7684\u521d\u59cb\u914d\u7f6e<\/h2>\n<p>\u7981\u7528\u865a\u62df\u673a\u4e2d\u4e0d\u5fc5\u8981\u7684\u786c\u4ef6\u3002<\/p>\n<p>\u53ea\u9700\u8981\u4e00\u4e2a\u9009\u9879\uff0c\u4ee5\u4e0b\u662f\u5bf9\u539f\u6587\u7684\u4e2d\u56fd\u7684\u7ffb\u8bd1\uff1a<br \/>\n1. \u53f3\u952e\u70b9\u51fb\u865a\u62df\u673avagrant-centos-7-x86_64-minimal-1708\u5e76\u9009\u62e9\u8bbe\u7f6e\u3002<br \/>\n2. \u6253\u5f00\u7cfb\u7edf\u9009\u9879\u5361\uff0c\u53d6\u6d88\u542f\u52a8\u987a\u5e8f\u4e2d\u7684\u8f6f\u76d8\u7684\u52fe\u9009\u3002<br \/>\n3. \u6253\u5f00\u97f3\u9891\u9009\u9879\u5361\uff0c\u53d6\u6d88\u542f\u7528\u97f3\u9891\u7684\u52fe\u9009\u3002<br \/>\n4. \u6253\u5f00\u7aef\u53e3\u9009\u9879\u5361\uff0c\u63a5\u7740\u6253\u5f00USB\u9009\u9879\u5361\uff0c\u5e76\u53d6\u6d88\u542f\u7528USB\u63a7\u5236\u5668\u7684\u52fe\u9009\u3002<br \/>\n5. \u70b9\u51fb\u786e\u5b9a\u3002<\/p>\n<h2>\u914d\u7f6e\u7aef\u53e3\u8f6c\u53d1<\/h2>\n<p>1. \u53f3\u952e\u70b9\u51fb\u865a\u62df\u673avagrant-centos-7-x86_64-minimal-1708\u5e76\u9009\u62e9\u8bbe\u7f6e\u3002<br \/>\n2. \u6253\u5f00\u7f51\u7edc\u9009\u9879\u5361\uff0c\u70b9\u51fb\u9002\u914d\u56681\u4e2d\u7684\u9ad8\u7ea7\uff0c\u5e76\u6309\u4e0b\u7aef\u53e3\u8f6c\u53d1\u6309\u94ae\u3002<br \/>\n3. \u70b9\u51fb\u53f3\u4fa7\u7684\u52a0\u53f7\uff0c\u5c06\u4e3b\u673a\u7aef\u53e3\u8bbe\u7f6e\u4e3a2222\uff0c\u5ba2\u6237\u7aef\u7aef\u53e3\u8bbe\u7f6e\u4e3a22\uff0c\u7136\u540e\u6309\u4e0b\u786e\u5b9a\u6309\u94ae\u3002<br \/>\n4. \u6309\u4e0b\u786e\u5b9a\u6309\u94ae\u3002<\/p>\n<h2>\u5c06CentOS7\u7684\u5b89\u88c5\u4ecb\u8d28\u914d\u7f6e\u5230\u865a\u62df\u673a\u4e2d\u5e76\u542f\u52a8\u3002<\/h2>\n<p>\u5c06CentOS7\u7684\u5b89\u88c5\u5a92\u4f53\u8bbe\u7f6e\u5230\u865a\u62df\u673a\u4e2d\u5e76\u542f\u52a8\u3002<\/p>\n<p>1. \u53f3\u51fb\u865a\u62df\u673avagrant-centos-7-x86_64-minimal-1708\u5e76\u9009\u62e9\u8bbe\u7f6e\u3002<br \/>\n2. \u6253\u5f00\u5b58\u50a8\u9009\u9879\u5361\uff0c\u9009\u62e9\u6302\u8f7d\u5728IDE\u63a7\u5236\u5668\u4e0b\u7684\u7a7a\u767d\u3002<br \/>\n3. \u70b9\u51fb\u5149\u9a71\u53f3\u4fa7\u7684CD\u6807\u5fd7\u56fe\u6807\uff0c\u9009\u62e9\u865a\u62df\u5149\u5b66\u78c1\u76d8\u6587\u4ef6\u3002<br \/>\n4. \u9009\u62e9\u9884\u5148\u4e0b\u8f7d\u7684CentOS-7-x86_64-Minimal-1708.iso\u3002<br \/>\n5. \u70b9\u51fb\u786e\u5b9a\u3002<br \/>\n6. \u53f3\u51fb\u865a\u62df\u673avagrant-centos-7-x86_64-minimal-1708\u5e76\u9009\u62e9\u542f\u52a8 -&gt; \u6b63\u5e38\u542f\u52a8\u3002<\/p>\n<h2>\u5b89\u88c5CentOS7<\/h2>\n<p>1. \u9009\u62e9\u5b89\u88c5 CentOS 7\u3002<br \/>\n2. \u5728\u5b89\u88c5\u65f6\u9009\u62e9\u4f7f\u7528\u7684\u8bed\u8a00\u4e3a\u65e5\u8bed\u3002<br \/>\n3. \u70b9\u51fb\u7cfb\u7edf\u7684\u5b89\u88c5\u4f4d\u7f6e\uff0c\u5c06\u6587\u4ef6\u7cfb\u7edf\u66f4\u6539\u4e3a\u6240\u9700\u7684\u5e03\u5c40\u3002\u5982\u679c\u662f\u7528\u4e8e\u6d4b\u8bd5\u76ee\u7684\uff0c\u5c06\u5206\u914d\u7ed9\u6302\u8f7d\u70b9\/\u7684\u7a7a\u95f4\u8bbe\u7f6e\u4e3agrow\u3002<br \/>\n4. \u5f00\u59cb\u5b89\u88c5\u3002<br \/>\n5. \u5728\u5b89\u88c5\u8fc7\u7a0b\u4e2d\u8bbe\u7f6e ROOT \u5bc6\u7801\u3002\u5bc6\u7801\u8bbe\u4e3a vagrant\u3002<br \/>\n6. \u7b49\u5f85\u5b89\u88c5\u5b8c\u6210\u3002<\/p>\n<h2>\u767b\u5f55<\/h2>\n<p>\u5728\u63a7\u5236\u53f0\u8fdb\u884c\u767b\u5f55\u3002<\/p>\n<p>\u767b\u5f55\u8d26\u6237\uff1aroot<br \/>\n\u5bc6\u7801\uff1avagrant<\/p>\n<h2>\u4e34\u65f6\u7981\u7528SELinux<\/h2>\n<pre class=\"post-pre\"><code># setenforce 0\r\n<\/code><\/pre>\n<h2>\u7f51\u7edc\u542f\u52a8\u8bbe\u7f6e<\/h2>\n<p>1. \u786e\u8ba4\u63a5\u53e3\u540d\u79f0<\/p>\n<pre class=\"post-pre\"><code># nmcli c s\r\nNAME    UUID                                  TYPE            DEVICE\r\nenp0s3  xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx  802-3-ethernet  --\r\n<\/code><\/pre>\n<p>\u8bbe\u7f6eONBOOT\u9009\u9879\u4e3ayes\u65f6\uff0c\u540c\u65f6\u4e5f\u4f1a\u901a\u8fc7DHCP\u8fde\u63a5\u5230\u7f51\u7edc\u3002<\/p>\n<pre class=\"post-pre\"><code># nmcli c m enp0s3 connection.autoconnect yes\r\n<\/code><\/pre>\n<p>\u8bf7\u5c06\u300c\u203benp0s3\u300d\u66ff\u6362\u4e3a\u521a\u624d\u67e5\u8be2\u5230\u7684\u63a5\u53e3\u540d\u3002<\/p>\n<h2>\u7528ssh\u8fdb\u884c\u767b\u5f55<\/h2>\n<p>\u4ece\u8fd9\u91cc\u5f00\u59cb\uff0c\u4f7f\u7528\u7ec8\u7aef\u8f6f\u4ef6\u8fde\u63a5\u5e76\u8fdb\u884c\u64cd\u4f5c\u3002<br \/>\n\u4f7f\u7528\u590d\u5236\u548c\u7c98\u8d34\u529f\u80fd\u4f1a\u4f7f\u5de5\u4f5c\u66f4\u52a0\u8f7b\u677e\u3002<\/p>\n<p>\u5728\u767b\u5f55\u4e4b\u524d\uff0c\u9700\u8981\u8fdb\u884c\u7aef\u53e3\u8f6c\u53d1\u7684\u8bbe\u7f6e\u3002<br \/>\n\u4eceVirtual BOX\u7684\u8bbe\u7f6e\u754c\u9762\u4e2d\uff0c\u9009\u62e9\u7f51\u7edc\u3001\u9ad8\u7ea7\u3001\u7aef\u53e3\u8f6c\u53d1\u9009\u9879\uff0c<br \/>\n\u5c06\u4e3b\u673a\u7aef\u53e3\u8bbe\u7f6e\u4e3a2222\uff0c\u5ba2\u6237\u7aef\u7aef\u53e3\u8bbe\u7f6e\u4e3a22\uff0c\u5e76\u70b9\u51fb\u786e\u5b9a\u6309\u94ae\u3002\u518d\u6b21\u70b9\u51fb\u786e\u5b9a\u6309\u94ae\u3002<\/p>\n<h3>\u767b\u5f55\u4fe1\u606f<\/h3>\n<div>\n<div class=\"post-table\">\u9805\u76ee\u5024\u30db\u30b9\u30c8127.0.0.1\u30dd\u30fc\u30c82222\u30e6\u30fc\u30b6root\u30d1\u30b9\u30ef\u30fc\u30c9vagrant<\/div>\n<\/div>\n<pre class=\"post-pre\"><code>$ ssh -p 2222 root@127.0.0.1\r\n<\/code><\/pre>\n<p>\u5982\u679c\u60a8\u4f7f\u7528Windows\u64cd\u4f5c\u7cfb\u7edf\uff0c\u8bf7\u4f7f\u7528Teraterm\u3001Putty\u3001Poderosa\u6216Rlogin\u7b49\u5de5\u5177\u3002<\/p>\n<h2>\u6c38\u4e45\u505c\u7528SELinux<\/h2>\n<pre class=\"post-pre\"><code># sed -i 's\/^SELINUX=enforcing\/SELINUX=disabled\/' \/etc\/selinux\/config\r\n<\/code><\/pre>\n<h2>\u6dfb\u52a0Vagrant\u7528\u6237<\/h2>\n<p>\u521b\u5efa\u4e00\u4e2a\u540d\u4e3avagrant\u7684\u7528\u6237\uff0c\u5e76\u5c06\u5bc6\u7801\u8bbe\u4e3avagrant\u3002<br \/>\n\u540c\u65f6\u8fdb\u884csudoers\u7684\u8bbe\u7f6e\u3002<\/p>\n<pre class=\"post-pre\"><code># groupadd -g 500 vagrant\r\n# useradd -g vagrant -u 500 vagrant\r\n# passwd vagrant\r\n\u203b\u30d1\u30b9\u30ef\u30fc\u30c9\u306f\u300cvagrant\u300d\u3068\u3059\u308b\r\n\r\n# echo 'Defaults:vagrant !requiretty' &gt; \/etc\/sudoers.d\/vagrant\r\n# echo \"vagrant ALL=(ALL) NOPASSWD: ALL\" &gt;&gt; \/etc\/sudoers.d\/vagrant\r\n<\/code><\/pre>\n<h2>\u9700\u8981\u5c06\u4ee5\u4e0b\u5185\u5bb9\u4ee5\u4e2d\u6587\u539f\u751f\u65b9\u5f0f\u8fdb\u884c\u8f6c\u8ff0\uff0c\u53ea\u9700\u63d0\u4f9b\u4e00\u4e2a\u9009\u9879\uff1a<\/h2>\n<p>&#8220;Vagrant ssh\u7684\u914d\u7f6e&#8221;<\/p>\n<pre class=\"post-pre\"><code># mkdir \/home\/vagrant\/.ssh\r\n# chown vagrant:vagrant \/home\/vagrant\/.ssh\r\n# chmod 700 \/home\/vagrant\/.ssh\r\n# echo \"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ==\" &gt; \/home\/vagrant\/.ssh\/authorized_keys\r\n# chown vagrant:vagrant \/home\/vagrant\/.ssh\/authorized_keys\r\n# chmod 600 \/home\/vagrant\/.ssh\/authorized_keys\r\n<\/code><\/pre>\n<h2>\u5b89\u88c5GuestAdditions<\/h2>\n<h3>\u51c6\u5907\u5b89\u88c5GuestAdditions<\/h3>\n<pre class=\"post-pre\"><code># yum -y install epel-release\r\n# yum -y install -y bzip2 gcc make kernel-devel-`uname -r` dkms gcc-c++\r\n<\/code><\/pre>\n<h3>\u8bf7\u63d0\u4f9b\u5ba2\u5ea7\u6dfb\u52a0\u7684\u5149\u76d8\u6620\u50cf\u7684\u5957\u4ef6\u3002<\/h3>\n<p>\u5728VirtualBox\u7684guest\u63a7\u5236\u53f0\u7a97\u53e3\u4e2d\uff0c\u9009\u62e9\u83dc\u5355\u680f\u4e2d\u7684&#8221;Devices&#8221;\uff0c\u7136\u540e\u9009\u62e9&#8221;Insert Guest Additions CD image&#8230;&#8221;<\/p>\n<h3>\u5b89\u88c5GuestAdditions<\/h3>\n<p>\u56de\u5230\u7ec8\u7aef\u5e76\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u3002<\/p>\n<pre class=\"post-pre\"><code># mount -r \/dev\/cdrom \/media\r\n# \/media\/VBoxLinuxAdditions.run --nox11\r\nVerifying archive integrity... All good.\r\nUncompressing VirtualBox 5.2.6 Guest Additions for Linux........\r\nVirtualBox Guest Additions installer\r\nCopying additional installer modules ...\r\nInstalling additional modules ...\r\nVirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel modules.\r\nVirtualBox Guest Additions: Starting.\r\n<\/code><\/pre>\n<h3>\u5378\u8f7d\u201cGuest Additions CD\u201d<\/h3>\n<pre class=\"post-pre\"><code># umount \/media\r\n<\/code><\/pre>\n<h2>\u5c3d\u91cf\u51cf\u5c0f\u76d2\u5b50\u7684\u5927\u5c0f<\/h2>\n<p>\u5220\u9664\u4e0d\u5fc5\u8981\u7684\u7269\u54c1\u3002<br \/>\n\u4f7f\u7528dd\u548crm\u547d\u4ee4\u53ef\u4ee5\u5c06\u76d2\u5b50\u53d8\u5f97\u66f4\u5c0f\uff0c\u5c31\u50cf\u9b54\u6cd5\u4e00\u6837\u3002<\/p>\n<pre class=\"post-pre\"><code># rm \/root\/.bash_history\r\n# rm -rf \/var\/cache\/yum\r\n# rm -fr \/var\/log\/*\r\n# rm -fr \/tmp\/*\r\n# dd if=\/dev\/zero of=\/0 bs=4k\r\n# rm -f \/0\r\n# history -c\r\n<\/code><\/pre>\n<h2>\u5173\u673a<\/h2>\n<pre class=\"post-pre\"><code># shutdown -h now\r\n<\/code><\/pre>\n<h2>\u521b\u5efa\u76d2\u5b50<\/h2>\n<p>\u4ece\u8fd9\u91cc\u5f00\u59cb\uff0c\u6211\u4eec\u5c06\u5728\u672c\u5730\u8fdb\u884c\u5de5\u4f5c\u3002<\/p>\n<pre class=\"post-pre\"><code>\u30dc\u30c3\u30af\u30b9\u4f5c\u6210\u524d\u306b\u30e1\u30e2\u30ea\u3092512M\u306b\u3057\u3066\u304a\u304f\u3002\r\n$ VBoxManage modifyvm vagrant-centos-7-x86_64-minimal-1708 --memory 512\r\n\r\n\u30dc\u30c3\u30af\u30b9\u306e\u4f5c\u6210\r\n$ vagrant package --base vagrant-centos-7-x86_64-minimal-1708\r\n==&gt; vagrant-centos-7-x86_64-minimal-1708: Clearing any previously set forwarded ports...\r\n==&gt; vagrant-centos-7-x86_64-minimal-1708: Exporting VM...\r\n==&gt; vagrant-centos-7-x86_64-minimal-1708: Compressing package to: \/Users\/moonphase\/package.box\r\n\r\n$ ls -l package.box\r\n-rw-r--r--  1 tuemura  1219831777  539693954  1 21 06:44 package.box\r\n<\/code><\/pre>\n<h2>\u6dfb\u52a0\u4e00\u4e2a\u76d2\u5b50<\/h2>\n<pre class=\"post-pre\"><code>$ vagrant box add centos-7-1708 package.box\r\n==&gt; box: Box file was not detected as metadata. Adding it directly...\r\n==&gt; box: Adding box 'centos-7-1708' (v0) for provider:\r\n    box: Unpacking necessary files from: file:\/\/\/Users\/moonphase\/package.box\r\n==&gt; box: Successfully added box 'centos-7-1708' (v0) for 'virtualbox'!\r\n\r\n$ vagrant box list\r\ncentos-7-1708      (virtualbox, 0)\r\n<\/code><\/pre>\n<h2>\u521b\u5efa\u548c\u767b\u5f55\u865a\u62df\u673a<\/h2>\n<p>\u5728\u521b\u5efa\u7684\u76d2\u5b50\u4e2d\u521b\u5efa\u865a\u62df\u673a\u5e76\u5c1d\u8bd5\u767b\u5f55\u3002<\/p>\n<pre class=\"post-pre\"><code>$ mkdir centos-7-1708-test\r\n$ cd centos-7-1708-test\r\n$ vagrant init centos-7-1708\r\nA `Vagrantfile` has been placed in this directory. You are now\r\nready to `vagrant up` your first virtual environment! Please read\r\nthe comments in the Vagrantfile as well as documentation on\r\n`vagrantup.com` for more information on using Vagrant.\r\n\r\n$ vagrant up\r\nBringing machine 'default' up with 'virtualbox' provider...\r\n==&gt; default: Importing base box 'centos-7-1708'...\r\n==&gt; default: Matching MAC address for NAT networking...\r\n==&gt; default: Setting the name of the VM: centos-7-1708-test_default_1516934907514_84187\r\n==&gt; default: Clearing any previously set network interfaces...\r\n==&gt; default: Preparing network interfaces based on configuration...\r\n    default: Adapter 1: nat\r\n==&gt; default: Forwarding ports...\r\n    default: 22 (guest) =&gt; 2222 (host) (adapter 1)\r\n==&gt; default: Booting VM...\r\n==&gt; default: Waiting for machine to boot. This may take a few minutes...\r\n    default: SSH address: 127.0.0.1:2222\r\n    default: SSH username: vagrant\r\n    default: SSH auth method: private key\r\n    default:\r\n    default: Vagrant insecure key detected. Vagrant will automatically replace\r\n    default: this with a newly generated keypair for better security.\r\n    default:\r\n    default: Inserting generated public key within guest...\r\n    default: Removing insecure key from the guest if it's present...\r\n    default: Key inserted! Disconnecting and reconnecting using new SSH key...\r\n==&gt; default: Machine booted and ready!\r\n==&gt; default: Checking for guest additions in VM...\r\n==&gt; default: Mounting shared folders...\r\n    default: \/vagrant =&gt; \/Users\/moonphase\/centos-7-1708-test\r\n\r\n$ vagrant ssh\r\n<\/code><\/pre>\n<p>\u5982\u679c\u53ef\u4ee5\u767b\u5f55\uff0c\u90a3\u5c31\u597d\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148 \u6211\u4eec\u6b63\u5728\u5c06\u6d41\u7a0b\u4f18\u5316\u5f97\u6bd4\u4ee5\u524d\u66f4\u597d\u3002 \u5236\u4f5cCentOS7\u6f02\u4eae\u7684box\u5907\u5fd8\u5f55\uff08CentOS-7-1708\u7248\uff09\u3002 [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[227],"class_list":["post-28858","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-227"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u81ea\u5df1\u5236\u4f5c\u4e00\u4e2a\u5e72\u51c0\u7684CentOS7\u7684box\uff08CentOS-7-1708\u7248\u672c\uff09 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u5173\u4e8e\u81ea\u5df1\u5236\u4f5c\u4e00\u4e2a\u5e72\u51c0\u7684CentOS7\u7684box\uff08CentOS-7-1708\u7248\u672c\uff09\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u81ea\u5df1\u5236\u4f5c\u4e00\u4e2a\u5e72\u51c0\u7684centos7\u7684box\uff08centos-7-1708\u7248\u672c\uff09\u3002-2\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u81ea\u5df1\u5236\u4f5c\u4e00\u4e2a\u5e72\u51c0\u7684CentOS7\u7684box\uff08CentOS-7-1708\u7248\u672c\uff09\" \/>\n<meta property=\"og:description\" content=\"\u5173\u4e8e\u81ea\u5df1\u5236\u4f5c\u4e00\u4e2a\u5e72\u51c0\u7684CentOS7\u7684box\uff08CentOS-7-1708\u7248\u672c\uff09\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u81ea\u5df1\u5236\u4f5c\u4e00\u4e2a\u5e72\u51c0\u7684centos7\u7684box\uff08centos-7-1708\u7248\u672c\uff09\u3002-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-27T16:53:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-12T02:29:04+00:00\" \/>\n<meta name=\"author\" content=\"\u6e05, \u626c\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u6e05, \u626c\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%b7%b1%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aa%e5%b9%b2%e5%87%80%e7%9a%84centos7%e7%9a%84box%ef%bc%88centos-7-1708%e7%89%88%e6%9c%ac%ef%bc%89%e3%80%82-2\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%b7%b1%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aa%e5%b9%b2%e5%87%80%e7%9a%84centos7%e7%9a%84box%ef%bc%88centos-7-1708%e7%89%88%e6%9c%ac%ef%bc%89%e3%80%82-2\/\",\"name\":\"\u81ea\u5df1\u5236\u4f5c\u4e00\u4e2a\u5e72\u51c0\u7684CentOS7\u7684box\uff08CentOS-7-1708\u7248\u672c\uff09 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-10-27T16:53:13+00:00\",\"dateModified\":\"2025-08-12T02:29:04+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461\"},\"description\":\"\u5173\u4e8e\u81ea\u5df1\u5236\u4f5c\u4e00\u4e2a\u5e72\u51c0\u7684CentOS7\u7684box\uff08CentOS-7-1708\u7248\u672c\uff09\u7684\u6280\u672f\u6587\u7ae0\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%b7%b1%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aa%e5%b9%b2%e5%87%80%e7%9a%84centos7%e7%9a%84box%ef%bc%88centos-7-1708%e7%89%88%e6%9c%ac%ef%bc%89%e3%80%82-2\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%b7%b1%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aa%e5%b9%b2%e5%87%80%e7%9a%84centos7%e7%9a%84box%ef%bc%88centos-7-1708%e7%89%88%e6%9c%ac%ef%bc%89%e3%80%82-2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%b7%b1%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aa%e5%b9%b2%e5%87%80%e7%9a%84centos7%e7%9a%84box%ef%bc%88centos-7-1708%e7%89%88%e6%9c%ac%ef%bc%89%e3%80%82-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u81ea\u5df1\u5236\u4f5c\u4e00\u4e2a\u5e72\u51c0\u7684CentOS7\u7684box\uff08CentOS-7-1708\u7248\u672c\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461\",\"name\":\"\u6e05, \u626c\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g\",\"caption\":\"\u6e05, \u626c\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/qingyang\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%b7%b1%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aa%e5%b9%b2%e5%87%80%e7%9a%84centos7%e7%9a%84box%ef%bc%88centos-7-1708%e7%89%88%e6%9c%ac%ef%bc%89%e3%80%82-2\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u81ea\u5df1\u5236\u4f5c\u4e00\u4e2a\u5e72\u51c0\u7684CentOS7\u7684box\uff08CentOS-7-1708\u7248\u672c\uff09 - Blog - Silicon Cloud","description":"\u5173\u4e8e\u81ea\u5df1\u5236\u4f5c\u4e00\u4e2a\u5e72\u51c0\u7684CentOS7\u7684box\uff08CentOS-7-1708\u7248\u672c\uff09\u7684\u6280\u672f\u6587\u7ae0","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u81ea\u5df1\u5236\u4f5c\u4e00\u4e2a\u5e72\u51c0\u7684centos7\u7684box\uff08centos-7-1708\u7248\u672c\uff09\u3002-2\/","og_locale":"zh_CN","og_type":"article","og_title":"\u81ea\u5df1\u5236\u4f5c\u4e00\u4e2a\u5e72\u51c0\u7684CentOS7\u7684box\uff08CentOS-7-1708\u7248\u672c\uff09","og_description":"\u5173\u4e8e\u81ea\u5df1\u5236\u4f5c\u4e00\u4e2a\u5e72\u51c0\u7684CentOS7\u7684box\uff08CentOS-7-1708\u7248\u672c\uff09\u7684\u6280\u672f\u6587\u7ae0","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u81ea\u5df1\u5236\u4f5c\u4e00\u4e2a\u5e72\u51c0\u7684centos7\u7684box\uff08centos-7-1708\u7248\u672c\uff09\u3002-2\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-10-27T16:53:13+00:00","article_modified_time":"2025-08-12T02:29:04+00:00","author":"\u6e05, \u626c","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u6e05, \u626c","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%b7%b1%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aa%e5%b9%b2%e5%87%80%e7%9a%84centos7%e7%9a%84box%ef%bc%88centos-7-1708%e7%89%88%e6%9c%ac%ef%bc%89%e3%80%82-2\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%b7%b1%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aa%e5%b9%b2%e5%87%80%e7%9a%84centos7%e7%9a%84box%ef%bc%88centos-7-1708%e7%89%88%e6%9c%ac%ef%bc%89%e3%80%82-2\/","name":"\u81ea\u5df1\u5236\u4f5c\u4e00\u4e2a\u5e72\u51c0\u7684CentOS7\u7684box\uff08CentOS-7-1708\u7248\u672c\uff09 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-10-27T16:53:13+00:00","dateModified":"2025-08-12T02:29:04+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461"},"description":"\u5173\u4e8e\u81ea\u5df1\u5236\u4f5c\u4e00\u4e2a\u5e72\u51c0\u7684CentOS7\u7684box\uff08CentOS-7-1708\u7248\u672c\uff09\u7684\u6280\u672f\u6587\u7ae0","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%b7%b1%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aa%e5%b9%b2%e5%87%80%e7%9a%84centos7%e7%9a%84box%ef%bc%88centos-7-1708%e7%89%88%e6%9c%ac%ef%bc%89%e3%80%82-2\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%b7%b1%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aa%e5%b9%b2%e5%87%80%e7%9a%84centos7%e7%9a%84box%ef%bc%88centos-7-1708%e7%89%88%e6%9c%ac%ef%bc%89%e3%80%82-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%b7%b1%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aa%e5%b9%b2%e5%87%80%e7%9a%84centos7%e7%9a%84box%ef%bc%88centos-7-1708%e7%89%88%e6%9c%ac%ef%bc%89%e3%80%82-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u81ea\u5df1\u5236\u4f5c\u4e00\u4e2a\u5e72\u51c0\u7684CentOS7\u7684box\uff08CentOS-7-1708\u7248\u672c\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461","name":"\u6e05, \u626c","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g","caption":"\u6e05, \u626c"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/qingyang\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e8%87%aa%e5%b7%b1%e5%88%b6%e4%bd%9c%e4%b8%80%e4%b8%aa%e5%b9%b2%e5%87%80%e7%9a%84centos7%e7%9a%84box%ef%bc%88centos-7-1708%e7%89%88%e6%9c%ac%ef%bc%89%e3%80%82-2\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/28858","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=28858"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/28858\/revisions"}],"predecessor-version":[{"id":98956,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/28858\/revisions\/98956"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=28858"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=28858"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=28858"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}