{"id":1279,"date":"2025-09-18T22:22:07","date_gmt":"2025-09-18T14:22:07","guid":{"rendered":"https:\/\/www.vcidc.net\/blog\/?p=1279"},"modified":"2025-09-18T22:22:07","modified_gmt":"2025-09-18T14:22:07","slug":"%e6%8e%a2%e7%b4%a2vlmcsd%ef%bc%9avirtualbox%e4%b8%ad%e7%9a%84%e8%bd%bb%e9%87%8f%e7%ba%a7%e5%ae%b9%e5%99%a8%e8%a7%a3%e5%86%b3%e6%96%b9%e6%a1%88","status":"publish","type":"post","link":"https:\/\/www.vcidc.net\/blog\/1279.html","title":{"rendered":"\u63a2\u7d22VLMCSD\uff1aVirtualBox\u4e2d\u7684\u8f7b\u91cf\u7ea7\u5bb9\u5668\u89e3\u51b3\u65b9\u6848"},"content":{"rendered":"<p><h2>\u4ec0\u4e48\u662fVLMCSD\uff1f<\/h2>\n<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/www.vcidc.net\/blog\/wp-content\/uploads\/2025\/07\/MK9Bem3.jpg\" alt=\"\u63a2\u7d22VLMCSD\uff1aVirtualBox\u4e2d\u7684\u8f7b\u91cf\u7ea7\u5bb9\u5668\u89e3\u51b3\u65b9\u6848\" title=\"\u63a2\u7d22VLMCSD\uff1aVirtualBox\u4e2d\u7684\u8f7b\u91cf\u7ea7\u5bb9\u5668\u89e3\u51b3\u65b9\u6848\"><\/p>\n<p>VLMCSD\u662f\u4e00\u79cd\u57fa\u4e8eVirtualBox\u7684\u8f7b\u91cf\u7ea7\u5bb9\u5668\u89e3\u51b3\u65b9\u6848\uff0c\u5b83\u5141\u8bb8\u7528\u6237\u5728VirtualBox\u865a\u62df\u673a\u4e2d\u521b\u5efa\u548c\u7ba1\u7406\u5bb9\u5668\u3002VLMCSD\u901a\u8fc7VirtualBox\u7684API\u6765\u7ba1\u7406\u5bb9\u5668\uff0c\u4f7f\u5f97\u5bb9\u5668\u53ef\u4ee5\u50cf\u5728Docker\u4e2d\u4e00\u6837\u8fd0\u884c\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528VLMCSD\u521b\u5efa\u548c\u7ba1\u7406\u5bb9\u5668\uff0c\u5305\u62ec\u8be6\u7ec6\u7684\u64cd\u4f5c\u6b65\u9aa4\u3001\u547d\u4ee4\u793a\u4f8b\u53ca\u89e3\u91ca\u3002<\/p>\n<p><h2>\u672c\u6587\u4efb\u52a1<\/h2>\n<\/p>\n<p>\u672c\u6587\u7684\u4efb\u52a1\u662f\u6307\u5bfc\u7528\u6237\u5982\u4f55\u4f7f\u7528VLMCSD\u5728VirtualBox\u4e2d\u521b\u5efa\u548c\u7ba1\u7406\u5bb9\u5668\uff0c\u6db5\u76d6\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<p>1. \u5b89\u88c5\u548c\u914d\u7f6eVLMCSD<\/p>\n<p>2. \u521b\u5efa\u5bb9\u5668<\/p>\n<p>3. \u8fd0\u884c\u5bb9\u5668<\/p>\n<p>4. \u505c\u6b62\u548c\u5220\u9664\u5bb9\u5668<\/p>\n<p>5. \u6ce8\u610f\u4e8b\u9879\u548c\u5b9e\u7528\u6280\u5de7<\/p>\n<p><h2>\u5b89\u88c5\u548c\u914d\u7f6eVLMCSD<\/h2>\n<\/p>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u5728\u60a8\u7684\u7cfb\u7edf\u4e0a\u5b89\u88c5VirtualBox\u3002\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884cVLMCSD\u7684\u5b89\u88c5\u548c\u914d\u7f6e\uff1a<\/p>\n<p><h3>1. \u5b89\u88c5VLMCSD<\/h3>\n<\/p>\n<p>\u60a8\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5VLMCSD\uff1a<\/p>\n<p><pre><code>pip install vlmcsd<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2. \u914d\u7f6eVLMCSD<\/h3>\n<\/p>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u60a8\u9700\u8981\u914d\u7f6eVLMCSD\u3002\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a`config.py`\u7684\u6587\u4ef6\uff0c\u5e76\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<p><pre><code>import vlmcsd<\/p>\r\n\r\n<p># VirtualBox\u7684\u8def\u5f84<\/p>\r\n<p>virtualbox_path = \"\/usr\/bin\/VBoxManage\"<\/p>\r\n<p># \u5bb9\u5668\u5b58\u50a8\u8def\u5f84<\/p>\r\n<p>container_path = \"\/var\/lib\/vlmcsd\"<\/p>\r\n<p># \u5bb9\u5668\u6570\u91cf\u9650\u5236<\/p>\r\n<p>max_containers = 10<\/p>\r\n\r\n<p># \u521b\u5efaVLMCSD\u914d\u7f6e<\/p>\r\n<p>config = vlmcsd.VLConfig(virtualbox_path, container_path, max_containers)<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u521b\u5efa\u5bb9\u5668<\/h2>\n<\/p>\n<p>\u521b\u5efa\u5bb9\u5668\u662f\u4f7f\u7528VLMCSD\u7684\u7b2c\u4e00\u4e2a\u6b65\u9aa4\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u521b\u5efa\u4e00\u4e2a\u57fa\u4e8eUbuntu 20.04\u7684\u5bb9\u5668\uff1a<\/p>\n<p><h3>1. \u521b\u5efa\u865a\u62df\u673a<\/h3>\n<\/p>\n<p>\u9996\u5148\uff0c\u60a8\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u865a\u62df\u673a\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a`my-container`\u7684\u865a\u62df\u673a\uff1a<\/p>\n<p><pre><code>virtualbox createvm --name my-container --ostype Ubuntu_64 --memory 1024 --cpus 2<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2. \u542f\u52a8\u865a\u62df\u673a<\/h3>\n<\/p>\n<p>\u542f\u52a8\u865a\u62df\u673a\uff0c\u5e76\u6309\u7167\u63d0\u793a\u5b8c\u6210\u5b89\u88c5\uff1a<\/p>\n<p><pre><code>virtualbox startvm my-container<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>3. \u521b\u5efa\u5bb9\u5668<\/h3>\n<\/p>\n<p>\u5728\u865a\u62df\u673a\u5185\u90e8\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a`my-container`\u7684\u5bb9\u5668\uff1a<\/p>\n<p><pre><code>sudo vlmcsd create my-container<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u8fd0\u884c\u5bb9\u5668<\/h2>\n<\/p>\n<p>\u521b\u5efa\u5bb9\u5668\u540e\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8\u5b83\uff1a<\/p>\n<p><pre><code>sudo vlmcsd run my-container<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p>\u6b64\u65f6\uff0c\u5bb9\u5668\u5c06\u542f\u52a8\u5e76\u8fd0\u884c\u5728\u865a\u62df\u673a\u5185\u90e8\u3002<\/p>\n<p><h2>\u505c\u6b62\u548c\u5220\u9664\u5bb9\u5668<\/h2>\n<\/p>\n<p>\u5f53\u60a8\u4e0d\u518d\u9700\u8981\u5bb9\u5668\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u505c\u6b62\u548c\u5220\u9664\u5b83\uff1a<\/p>\n<p><h3>1. \u505c\u6b62\u5bb9\u5668<\/h3>\n<\/p>\n<p><pre><code>sudo vlmcsd stop my-container<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h3>2. \u5220\u9664\u5bb9\u5668<\/h3>\n<\/p>\n<p><pre><code>sudo vlmcsd rm my-container<\/p>\r\n<p><\/code><\/pre>\n<\/p>\n<p><h2>\u6ce8\u610f\u4e8b\u9879\u548c\u5b9e\u7528\u6280\u5de7<\/h2>\n<\/p>\n<ul>\n<li>\u786e\u4fddVirtualBox\u548cVLMCSD\u90fd\u6b63\u786e\u5b89\u88c5\u548c\u914d\u7f6e\u3002<\/li>\n<li>\u5728\u521b\u5efa\u5bb9\u5668\u65f6\uff0c\u786e\u4fdd\u865a\u62df\u673a\u5df2\u542f\u52a8\u3002<\/li>\n<li>\u5bb9\u5668\u5185\u90e8\u53ef\u4ee5\u50cf\u5728\u7269\u7406\u673a\u4e0a\u4e00\u6837\u8fd0\u884c\u4efb\u4f55\u5e94\u7528\u7a0b\u5e8f\u3002<\/li>\n<li>\u60a8\u53ef\u4ee5\u4e3a\u6bcf\u4e2a\u5bb9\u5668\u8bbe\u7f6e\u4e0d\u540c\u7684\u6743\u9650\u548c\u8d44\u6e90\u9650\u5236\u3002<\/li>\n<\/ul>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528VLMCSD\u5728VirtualBox\u4e2d\u521b\u5efa\u548c\u7ba1\u7406\u5bb9\u5668\u3002\u5e0c\u671b\u672c\u6587\u5bf9\u60a8\u6709\u6240\u5e2e\u52a9\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ec0\u4e48\u662fVLMCSD\uff1f VLMCSD\u662f\u4e00\u79cd\u57fa\u4e8eVirtualBox\u7684\u8f7b\u91cf\u7ea7\u5bb9\u5668\u89e3\u51b3\u65b9\u6848\uff0c\u5b83\u5141\u8bb8\u7528\u6237\u5728VirtualBox\u865a\u62df\u673a\u4e2d\u521b\u5efa\u548c\u7ba1\u7406\u5bb9\u5668\u3002VLMCSD\u901a\u8fc7VirtualBox\u7684API\u6765\u7ba1\u7406\u5bb9\u5668\uff0c\u4f7f\u5f97\u5bb9\u5668\u53ef\u4ee5\u50cf\u5728Docker\u4e2d\u4e00\u6837\u8fd0\u884c\u3002\u672c&#8230;<\/p>\n","protected":false},"author":1,"featured_media":1280,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[259,461,462],"topic":[],"class_list":["post-1279","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-game-server","tag-virtualbox","tag-vlmcsd","tag-462"],"_links":{"self":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts\/1279","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/comments?post=1279"}],"version-history":[{"count":1,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts\/1279\/revisions"}],"predecessor-version":[{"id":1282,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/posts\/1279\/revisions\/1282"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/media\/1280"}],"wp:attachment":[{"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/media?parent=1279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/categories?post=1279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/tags?post=1279"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.vcidc.net\/blog\/wp-json\/wp\/v2\/topic?post=1279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}