This commit is contained in:
2025-12-31 16:00:29 +00:00
commit 3688f93d5d
310 changed files with 93400 additions and 0 deletions

334
2020/09/10/site.html Normal file
View File

@@ -0,0 +1,334 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>如何建立一个校园内部网站 | Mayx的博客</title>
<meta name="generator" content="Jekyll v3.9.5" />
<meta property="og:title" content="如何建立一个校园内部网站" />
<meta name="author" content="mayx" />
<meta property="og:locale" content="zh_CN" />
<meta name="description" content="其实我感觉大学生活也挺好的。" />
<meta property="og:description" content="其实我感觉大学生活也挺好的。" />
<meta property="og:site_name" content="Mayx的博客" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2020-09-10T00:00:00+08:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="如何建立一个校园内部网站" />
<meta name="google-site-verification" content="huTYdEesm8NaFymixMNqflyCp6Jfvd615j5Wq1i2PHc" />
<meta name="msvalidate.01" content="0ADFCE64B3557DC4DC5F2DC224C5FDDD" />
<meta name="yandex-verification" content="fc0e535abed800be" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","author":{"@type":"Person","name":"mayx"},"dateModified":"2020-09-10T00:00:00+08:00","datePublished":"2020-09-10T00:00:00+08:00","description":"其实我感觉大学生活也挺好的。","headline":"如何建立一个校园内部网站","mainEntityOfPage":{"@type":"WebPage","@id":"/2020/09/10/site.html"},"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://avatars0.githubusercontent.com/u/17966333"},"name":"mayx"},"url":"/2020/09/10/site.html"}</script>
<!-- End Jekyll SEO tag -->
<link rel="canonical" href="https://mabbs.github.io/2020/09/10/site.html" />
<link type="application/atom+xml" rel="alternate" href="/atom.xml" title="Mayx的博客" />
<link rel="alternate" type="application/rss+xml" title="Mayx的博客(RSS)" href="/rss.xml" />
<link rel="alternate" type="application/json" title="Mayx的博客(JSON Feed)" href="/feed.json" />
<link rel="stylesheet" href="/assets/css/style.css?v=1767196818" />
<!--[if !IE]> -->
<link rel="stylesheet" href="/Live2dHistoire/live2d/css/live2d.css" />
<!-- <![endif]-->
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Mayx的博客" />
<link rel="webmention" href="https://webmention.io/mabbs.github.io/webmention" />
<link rel="pingback" href="https://webmention.io/mabbs.github.io/xmlrpc" />
<link rel="preconnect" href="https://summary.mayx.eu.org" crossorigin="anonymous" />
<link rel="prefetch" href="https://www.blogsclub.org/badge/mabbs.github.io" as="image" />
<link rel="blogroll" type="text/xml" href="/blogroll.opml" />
<link rel="me" href="https://github.com/Mabbs" />
<script src="/assets/js/jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
var lastUpdated = new Date("Thu, 01 Jan 2026 00:00:18 +0800");
var BlogAPI = "https://summary.mayx.eu.org";
</script>
<script src="/assets/js/main.js"></script>
<!--[if !IE]> -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-137710294-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-137710294-1');
</script>
<script src="/assets/js/instant.page.js" type="module"></script>
<!-- <![endif]-->
</head>
<body>
<!--[if !IE]> --><noscript><marquee style="top: -15px; position: relative;"><small>发现当前浏览器没有启用JavaScript这不影响你的浏览但可能会有一些功能无法使用……</small></marquee></noscript><!-- <![endif]-->
<!--[if IE]><marquee style="top: -15px; position: relative;"><small>发现当前浏览器为Internet Explorer这不影响你的浏览但可能会有一些功能无法使用……</small></marquee><![endif]-->
<div class="wrapper">
<header class="h-card">
<h1><a class="u-url u-uid p-name" rel="me" href="/">Mayx的博客</a></h1>
<img src="https://avatars0.githubusercontent.com/u/17966333" fetchpriority="high" class="u-photo" alt="Logo" style="width: 90%; max-width: 300px; max-height: 300px;" />
<p class="p-note">Mayx's Home Page</p>
<form action="/search.html">
<input type="text" name="keyword" id="search-input-all" placeholder="Search blog posts.." />&#160;<input type="submit" value="搜索" />
</form>
<br />
<p class="view"><a class="u-url" href="/Mabbs/">About me</a></p>
<ul class="downloads">
<li style="width: 270px; border-right: none;"><a href="/MayxBlog.tgz">Download <strong>TGZ File</strong></a></li>
</ul>
</header>
<section class="h-entry">
<small><time class="date dt-published" datetime="2020-09-10T00:00:00+08:00">10 September 2020</time> - 字数统计2181 - 阅读大约需要7分钟 - Hits: <span id="/2020/09/10/site.html" class="visitors">Loading...</span></small>
<h1 class="p-name">如何建立一个校园内部网站</h1>
<p class="view">by <a class="p-author h-card" href="//github.com/Mabbs">mayx</a></p>
<div id="outdate" style="display:none;">
<hr /><p>
这是一篇创建于 <span id="outime"></span> 天前的文章,其中的信息可能已经有所发展或是发生改变。
</p>
</div>
<script>
daysold = Math.floor((new Date().getTime() - new Date("Thu, 10 Sep 2020 00:00:00 +0800").getTime()) / (24 * 60 * 60 * 1000));
if (daysold > 90) {
document.getElementById("outdate").style.display = "block";
document.getElementById("outime").innerHTML = daysold;
}
</script>
<hr />
<b>AI摘要</b>
<p id="ai-output">这篇文章描述的是作者利用大学社团的服务器资源经历了一系列挫折后建立校园内部网站的过程。作者从最初打算安装ESXi和Hyper-V到尝试安装Ubuntu和CentOS遇到的困难如驱动问题和版本不匹配。最终选择了Cockpit面板方便管理并借助DDNS解决方案处理动态IP问题。作者还提到利用服务器资源进行了World Community Grid的志愿计算项目以合理利用计算能力。</p>
<hr />
<ul><li><a href="#起因">起因</a></li><li><a href="#服务器的折腾之旅">服务器的折腾之旅</a></li><li><a href="#如何公开自建服务器">如何公开自建服务器</a></li><li><a href="#给网站加个域名">给网站加个域名</a></li><li><a href="#合理利用资源">合理利用资源</a></li></ul>
<hr />
<main class="post-content e-content" role="main"><p>其实我感觉大学生活也挺好的。<!--more--></p>
<h1 id="起因">
<a href="#起因"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 起因
</h1>
<p>去年我进入大学后加入了一个专门研究云计算以及网络(名义上)的社团,不过那时候我才是大一新生,加入后没有权限。到了第二年,我成功的进入了管理层,这次我就可以好好的看看这个社团有什么有意思的东西了。 </p><p>
首先社团内有专属于自己的网络社团办公室内有一个交换机是连接所在教学楼的网络的。另外还有一个树莓派看起来好像是一次都没有用过系统也是全新的RPiOS。 </p><p>
除此之外,社团内有一台机架式服务器,看起来好像好长时间没有用了,第一次启动直接报内存错误,我只好把内存条拆出来擦了擦才能正常开机。 </p><p>
我以前觉得服务器应该配置相当高不来个双路TR3990X再整个一堆上TiB的内存根本不能称作服务器。不过这台垃圾服务器改变了我的想法。这是一台主板型号为S5500HCV的服务器有双路CPU和4条4GiB的内存条硬盘500GiB还是机械的。仔细看了看这双路的CPU怎么加起来才8个核心而且还不支持超线程这配置还不如我新买的笔记本电脑然后大小还特别大比一般的机箱大得多而且开机速度又慢风扇还不支持调速真是有够垃圾的。 </p><p>
不过垃圾就垃圾吧毕竟还是个服务器最起码还能支持24/7工作制365天全年不断电应该是可以保证的。既然有了这样的资源我觉得应该搞点什么在服务器上面不然这么大的东西闲置也挺浪费的。</p>
<h1 id="服务器的折腾之旅">
<a href="#服务器的折腾之旅"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 服务器的折腾之旅
</h1>
<p>最开始我是打算装ESXi的因为自从有Hyper-V之后我基本上就没用过VMWare了而且这俩还是互斥的。以前看到ESXi之后挺想在我的Hyper-V虚拟机里装一个可惜ESXi这个系统实在是太垃圾安装必须要网卡驱动然后它支持的驱动还特别少所以这次有了真正的服务器自然是想试一下装个ESXi玩玩。 </p><p>
首先我装的是ESXi7打开后结果又是没有显卡驱动所以我只好下ESXi6试试看打开之后确实可以装了但是装好之后却没办法引导了这就很奇怪所以我只好放弃安装ESXi的想法。 </p><p>
之后我就想着要不然就正常的安个服务器操作系统吧Ubuntu用的多了干脆安个CentOS好了。不过安CentOS有不少坑因为我安装没办法用光盘装一般都是先录到U盘里再装但是不知道为啥CentOS的引导是用的是卷标名然后U盘只能用11位的卷标名安装程序就没法引导。 </p><p>
除了这个坑之外还有一个就是8和8-stream版本的不同。因为直接把整个CentOS下下来很麻烦我就直接下的是网络安装版的。安装程序我下的是8-stream的但是我当时不知道用哪个源结果搞成了8的源装到一半就出错退出了很难受之后仔细检查才发现原来是版本搞错了。 </p><p>
安好之后就是如何管理服务器的问题了虽然直接用SSH或者用自带的Cockpit也挺不错显得很专业但是我觉得麻烦就直接用了某删库塔面板了反正是在内网里也没谁会攻击而且安装配置确实方便想做的事情一键就能搞定。 </p><p>
虽然这个服务器挺垃圾但是至少要比一般的云服务器强同配置的云服务器要不少钱我肯定是不会租当然也没用过。所以像什么Gitlab之类的我可以随便装反正有16GiB内存也不担心。 </p><p>
另外就是网页服务器的环境了,面板确实方便,轻轻松松就能装一个博客、论坛加网盘了。既然网站建好了,就要考虑如何访问的问题了。</p>
<h1 id="如何公开自建服务器">
<a href="#如何公开自建服务器"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 如何公开自建服务器
</h1>
<p>正常情况下我们用的网络都是经过路由器的然后就会有NAT就没法从外面访问里面的服务。一般情况下解决这个问题就是用内网穿透比如frp之类的。不过我们的网站不太适合暴露到外网上毕竟开了一大堆服务又没有防火墙密码还超级简单万一服务器被外面的人攻破了学校内网估计也得凉。 </p><p>
不能暴露在外网的话至少学校内网能访问也不错啊不过服务器前面连了一个路由器经过了一次转换然后就没办法在学校内访问了。还好路由器可以设置DMZ主机把服务器的内部IP设成静态的然后开DMZ主机就能解决这个问题了另外路由器连接的校园内网也没有NAT所以在校内就可以直接运行了。</p>
<h1 id="给网站加个域名">
<a href="#给网站加个域名"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 给网站加个域名
</h1>
<p>虽然通过上面的方法可以让大家访问服务器但是有一个问题就是动态IP的问题。我可以改在社团的路由器但是不能改学校的交换机所以IP地址没办法固定虽然也可以直接在服务器上改成固定IP但是我担心这样会造成IP冲突之类的问题。这种情况就很麻烦因为好多网站内链都是带站点地址的URL我建的网站都是通过引擎建的改又不好改这就很麻烦。 </p><p>
这个问题比较好的解决方案就是使用域名域名解析的结果不一定必须是一个外网地址内网地址同样可以解析。这样我回头可以买个域名然后解析如果发生断电之类的问题导致IP改变我就可以直接改一次就行了。DDNS也是个不错的解决方案不过这种事发生次数不多所以就懒得搞了。</p>
<h1 id="合理利用资源">
<a href="#合理利用资源"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 合理利用资源
</h1>
<p>虽然建了网站但是平时也没有人访问……而且就算有人访问服务器运行网站服务程序基本上没什么压力这样服务器运行基本上就是空转了。既然我打算让它持续运行肯定不能让它空转我肯定要搞点啥利用好这个运算资源。挖矿是个不错的选择但是我不屑于去做不如搞点为人类发展做出贡献的事情像World Community Grid这样的志愿计算项目就挺不错。 </p><p>
于是我就在上面安装了BOINC这种程序虽然会占用大量的运算资源但是它的运行优先级很低所以网站运行完全没有影响这样就能合理的运用好这些计算资源了。</p></main>
<small style="display: block">tags: <a rel="category tag" class="p-category" href="/search.html?keyword=%E7%BD%91%E7%AB%99"><em>网站</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=%E6%A0%A1%E5%9B%AD"><em>校园</em></a> <span style="float: right;"><a href="https://gitlab.com/mayx/mayx.gitlab.io/tree/master/_posts/2020-09-10-site.md">查看原始文件</a></span></small>
<h4 style="border-bottom: 1px solid #e5e5e5;margin: 2em 0 5px;">推荐文章</h4>
<p id="suggest-container">Loading...</p>
<script>
var suggest = $("#suggest-container");
$.get(BlogAPI + "/suggest?id=/2020/09/10/site.html&update=" + lastUpdated.valueOf(), function (data) {
if (data.length) {
getSearchJSON(function (search) {
suggest.empty();
var searchMap = {};
for (var i = 0; i < search.length; i++) {
searchMap[search[i].url] = search[i];
}
var tooltip = $('<div class="content-tooltip"></div>').appendTo('body').hide();
for (var j = 0; j < data.length; j++) {
var item = searchMap[data[j].id];
if (item) {
var link = $('<a href="' + item.url + '">' + item.title + '</a>');
var contentPreview = item.content.substring(0, 100);
if (item.content.length > 100) {
contentPreview += "……";
}
link.hover(
function(e) {
tooltip.text($(this).data('content'))
.css({
top: e.pageY + 10,
left: e.pageX + 10
})
.show();
},
function() {
tooltip.hide();
}
).mousemove(function(e) {
tooltip.css({
top: e.pageY + 10,
left: e.pageX + 10
});
}).data('content', contentPreview);
suggest.append(link);
suggest.append(' - ' + item.date + '<br />');
}
}
});
} else {
suggest.html("暂无推荐文章……");
}
});
</script>
<br />
<div class="pagination">
<span class="prev">
<a href="/2020/08/28/banned.html">
上一篇网站被Ban怎么办
</a>
</span>
<br />
<span class="next">
<a href="/2020/09/27/vm.html">
下一篇:关于虚拟化的学习记录
</a>
</span>
</div>
<!--[if !IE]> -->
<link rel="stylesheet" href="/assets/css/gitalk.css">
<script src="/assets/js/gitalk.min.js"></script>
<div id="gitalk-container"></div>
<script>
var gitalk = new Gitalk({
clientID: '36557aec4c3cb04f7ac6',
clientSecret: 'ac32993299751cb5a9ba81cf2b171cca65879cdb',
repo: 'mabbs.github.io',
owner: 'Mabbs',
admin: ['Mabbs'],
id: '/2020/09/10/site', // Ensure uniqueness and length less than 50
distractionFreeMode: false, // Facebook-like distraction free mode
proxy: "https://cors-anywhere.mayx.eu.org/?https://github.com/login/oauth/access_token"
})
gitalk.render('gitalk-container')
</script>
<!-- <![endif]-->
</section>
<!--[if !IE]> -->
<div id="landlord" style="left:5px;bottom:0px;">
<div class="message" style="opacity:0"></div>
<canvas id="live2d" width="500" height="560" class="live2d"></canvas>
<div class="live_talk_input_body">
<form id="live_talk_input_form">
<div class="live_talk_input_name_body" >
<input type="checkbox" id="load_this" />
<input type="hidden" id="post_id" value="/2020/09/10/site.html" />
<label for="load_this">
<span style="font-size: 11px; color: #fff;">&#160;想问这篇文章</span>
</label>
</div>
<div class="live_talk_input_text_body">
<input name="talk" type="text" class="live_talk_talk white_input" id="AIuserText" autocomplete="off" placeholder="要和我聊什么呀?" />
<button type="submit" class="live_talk_send_btn" id="talk_send">发送</button>
</div>
</form>
</div>
<input name="live_talk" id="live_talk" value="1" type="hidden" />
<div class="live_ico_box" style="display:none;">
<div class="live_ico_item type_info" id="showInfoBtn"></div>
<div class="live_ico_item type_talk" id="showTalkBtn"></div>
<div class="live_ico_item type_music" id="musicButton"></div>
<div class="live_ico_item type_youdu" id="youduButton"></div>
<div class="live_ico_item type_quit" id="hideButton"></div>
<input name="live_statu_val" id="live_statu_val" value="0" type="hidden" />
<audio src="" style="display:none;" id="live2d_bgm" data-bgm="0" preload="none"></audio>
<input id="duType" value="douqilai" type="hidden" />
</div>
</div>
<div id="open_live2d">召唤伊斯特瓦尔</div>
<!-- <![endif]-->
<footer>
<p>
<small>Made with ❤ by Mayx<br />Last updated at 2026-01-01 00:00:18<br /> 总字数614622 - 文章数178 - <a href="/atom.xml" >Atom</a> - <a href="/README.html" >About</a></small>
</p>
</footer>
</div>
<script src="/assets/js/scale.fix.js"></script>
<!--[if !IE]> -->
<script src="/assets/js/main_new.js"></script>
<script src="/Live2dHistoire/live2d/js/live2d.js"></script>
<script src="/Live2dHistoire/live2d/js/message.js"></script>
<!-- <![endif]-->
</body>
</html>

342
2020/09/27/vm.html Normal file
View File

@@ -0,0 +1,342 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Begin Jekyll SEO tag v2.8.0 -->
<title>关于虚拟化的学习记录 | Mayx的博客</title>
<meta name="generator" content="Jekyll v3.9.5" />
<meta property="og:title" content="关于虚拟化的学习记录" />
<meta name="author" content="mayx" />
<meta property="og:locale" content="zh_CN" />
<meta name="description" content="虚拟机……感觉有点哲学。" />
<meta property="og:description" content="虚拟机……感觉有点哲学。" />
<meta property="og:site_name" content="Mayx的博客" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2020-09-27T00:00:00+08:00" />
<meta name="twitter:card" content="summary" />
<meta property="twitter:title" content="关于虚拟化的学习记录" />
<meta name="google-site-verification" content="huTYdEesm8NaFymixMNqflyCp6Jfvd615j5Wq1i2PHc" />
<meta name="msvalidate.01" content="0ADFCE64B3557DC4DC5F2DC224C5FDDD" />
<meta name="yandex-verification" content="fc0e535abed800be" />
<script type="application/ld+json">
{"@context":"https://schema.org","@type":"BlogPosting","author":{"@type":"Person","name":"mayx"},"dateModified":"2020-09-27T00:00:00+08:00","datePublished":"2020-09-27T00:00:00+08:00","description":"虚拟机……感觉有点哲学。","headline":"关于虚拟化的学习记录","mainEntityOfPage":{"@type":"WebPage","@id":"/2020/09/27/vm.html"},"publisher":{"@type":"Organization","logo":{"@type":"ImageObject","url":"https://avatars0.githubusercontent.com/u/17966333"},"name":"mayx"},"url":"/2020/09/27/vm.html"}</script>
<!-- End Jekyll SEO tag -->
<link rel="canonical" href="https://mabbs.github.io/2020/09/27/vm.html" />
<link type="application/atom+xml" rel="alternate" href="/atom.xml" title="Mayx的博客" />
<link rel="alternate" type="application/rss+xml" title="Mayx的博客(RSS)" href="/rss.xml" />
<link rel="alternate" type="application/json" title="Mayx的博客(JSON Feed)" href="/feed.json" />
<link rel="stylesheet" href="/assets/css/style.css?v=1767196818" />
<!--[if !IE]> -->
<link rel="stylesheet" href="/Live2dHistoire/live2d/css/live2d.css" />
<!-- <![endif]-->
<link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Mayx的博客" />
<link rel="webmention" href="https://webmention.io/mabbs.github.io/webmention" />
<link rel="pingback" href="https://webmention.io/mabbs.github.io/xmlrpc" />
<link rel="preconnect" href="https://summary.mayx.eu.org" crossorigin="anonymous" />
<link rel="prefetch" href="https://www.blogsclub.org/badge/mabbs.github.io" as="image" />
<link rel="blogroll" type="text/xml" href="/blogroll.opml" />
<link rel="me" href="https://github.com/Mabbs" />
<script src="/assets/js/jquery.min.js"></script>
<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery-ajaxtransport-xdomainrequest/1.0.3/jquery.xdomainrequest.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<script>
var lastUpdated = new Date("Thu, 01 Jan 2026 00:00:18 +0800");
var BlogAPI = "https://summary.mayx.eu.org";
</script>
<script src="/assets/js/main.js"></script>
<!--[if !IE]> -->
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=UA-137710294-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-137710294-1');
</script>
<script src="/assets/js/instant.page.js" type="module"></script>
<!-- <![endif]-->
</head>
<body>
<!--[if !IE]> --><noscript><marquee style="top: -15px; position: relative;"><small>发现当前浏览器没有启用JavaScript这不影响你的浏览但可能会有一些功能无法使用……</small></marquee></noscript><!-- <![endif]-->
<!--[if IE]><marquee style="top: -15px; position: relative;"><small>发现当前浏览器为Internet Explorer这不影响你的浏览但可能会有一些功能无法使用……</small></marquee><![endif]-->
<div class="wrapper">
<header class="h-card">
<h1><a class="u-url u-uid p-name" rel="me" href="/">Mayx的博客</a></h1>
<img src="https://avatars0.githubusercontent.com/u/17966333" fetchpriority="high" class="u-photo" alt="Logo" style="width: 90%; max-width: 300px; max-height: 300px;" />
<p class="p-note">Mayx's Home Page</p>
<form action="/search.html">
<input type="text" name="keyword" id="search-input-all" placeholder="Search blog posts.." />&#160;<input type="submit" value="搜索" />
</form>
<br />
<p class="view"><a class="u-url" href="/Mabbs/">About me</a></p>
<ul class="downloads">
<li style="width: 270px; border-right: none;"><a href="/MayxBlog.tgz">Download <strong>TGZ File</strong></a></li>
</ul>
</header>
<section class="h-entry">
<small><time class="date dt-published" datetime="2020-09-27T00:00:00+08:00">27 September 2020</time> - 字数统计2492 - 阅读大约需要8分钟 - Hits: <span id="/2020/09/27/vm.html" class="visitors">Loading...</span></small>
<h1 class="p-name">关于虚拟化的学习记录</h1>
<p class="view">by <a class="p-author h-card" href="//github.com/Mabbs">mayx</a></p>
<div id="outdate" style="display:none;">
<hr /><p>
这是一篇创建于 <span id="outime"></span> 天前的文章,其中的信息可能已经有所发展或是发生改变。
</p>
</div>
<script>
daysold = Math.floor((new Date().getTime() - new Date("Sun, 27 Sep 2020 00:00:00 +0800").getTime()) / (24 * 60 * 60 * 1000));
if (daysold > 90) {
document.getElementById("outdate").style.display = "block";
document.getElementById("outime").innerHTML = daysold;
}
</script>
<hr />
<b>AI摘要</b>
<p id="ai-output">这篇文章是关于作者的虚拟化学习经历从早期的PC虚拟机软件VMware Workstation和Hyper-V的比较到手机上的虚拟机如DOSBox Turbo、Bochs、qemu和VMOS的使用以及对虚拟化概念的哲学思考。作者提到虚拟机技术的发展包括资源管理和隔离性同时提到了操作系统、BIOS和虚拟化的界限指出虚拟化并非简单的资源复制而涉及到复杂的逻辑和实际运行环境的问题如虚拟化集群中的通信挑战。</p>
<hr />
<ul><li><a href="#mayx的虚拟化学习史">Mayx的虚拟化学习史</a><ul><li><a href="#pc上的虚拟机使用史">PC上的虚拟机使用史</a></li><li><a href="#手机的虚拟机使用史">手机的虚拟机使用史</a></li><li><a href="#其他平台的虚拟机">其他平台的虚拟机</a></li></ul></li><li><a href="#对虚拟化概念的探索">对虚拟化概念的探索</a></li><li><a href="#未解决的问题">未解决的问题</a></li></ul>
<hr />
<main class="post-content e-content" role="main"><p>虚拟机……感觉有点哲学。<!--more--></p>
<h1 id="mayx的虚拟化学习史">
<a href="#mayx的虚拟化学习史"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> Mayx的虚拟化学习史
</h1>
<h2 id="pc上的虚拟机使用史">
<a href="#pc上的虚拟机使用史"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> PC上的虚拟机使用史
</h2>
<p>在我小的时候我就玩过虚拟机那时候Windows10还没有出来用的还是WindowsXP的系统那时候我使用的虚拟机软件是VMWare Workstation。过去的VMWare和现在的感觉区别不大十年过去了感觉加的功能也不多非要说哪个功能有更新的话可能也就是随着现在的物理机更新一样增加了一些比如UEFI之类的功能吧。 </p><p>
后来我用上了Windows10那时候我还是第一批用上Windows10的人正式版还没有出来我就已经用上了技术预览版不过直到正式版出来我依然使用的是VMWare做虚拟机。后来我在系统里乱逛的时候发现了Hyper-V那是一个比VMWare更轻量更底层的一个虚拟机不需要下载其他程序就能在Windows10里直接打开非常方便。 </p><p>
自从我知道了Hyper-V后就再不用VMWare了除了两个不能共存的原因之外还有就是Hyper-V感觉更稳定速度更快而且与Windows的结合更好。不过有一个缺点就是没有办法挂载USB设备这个就很麻烦…… </p><p>
以前我在用VMWare的时候经常遇到一个问题就是有时候虚拟机里面的系统卡死了但是我点关机的时候用的是客户机关机然后VMWare就卡死了。这时候就算结束掉它用来获取计算资源的进程<code class="language-plaintext highlighter-rouge">vmware-vmx.exe</code>也没用就算是注销也不行只能关机重启之后也经常会因为锁的原因而出现打不开的问题就很麻烦。但是自从我用了Hyper-V之后就再也没有遇到过这种情况大概是因为Hyper-V对资源的管控更好吧基本上不会出现虚拟机把物理机怼死的情况。 </p><p>
说到这里就让我想起最近我安装的ESXi了由于我的主电脑用的是Hyper-V垃圾ESXi没有Hyper-V网卡的驱动然后就怎么装都装不上然后没办法我就只能用我的旧电脑安结果安好之后发生了一个很神奇的事情就是用ESXi创建一个虚拟机然后启动之后物理机就直接断电重启了这就有点不太合适了虚拟机无论怎么搞能影响到物理机就不太合格了啊。 </p><p>
总的来说可以发现PC机虚拟化的软件基本上都是依靠CPU内置的虚拟化指令来运行的所以效率很高。</p>
<h2 id="手机的虚拟机使用史">
<a href="#手机的虚拟机使用史"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 手机的虚拟机使用史
</h2>
<p>手机上我也安装过不少种类的虚拟机最早我用的手机性能很差好像还是清华紫光的CPU。那个垃圾手机当时我还拿来当服务器使。虽然我也知道其他的虚拟机但是那个手机带不起来我记得最早我用的是DOSBox Turbo在那个上面我安装了一个Windows3.2的系统。不过这个软件除了这一个虚拟机就不能再开别的系统了,而且基本上没有隔离,它可以直接访问手机里的文件,这就不太好。 </p><p>
后来我用上了一个稍微好一点的手机那时候我知道了Bochs不过那个系统不是我自己装的那个软件的配置文件对那时候的我来说太复杂了我看不懂所以是直接用的贴吧上的镜像。 </p><p>
知道了Bochs之后我就了解到了Limbo那是一个基于qemu的虚拟机用起来要比Bochs简单很多不用写配置文件就可以直接使用。所以这个东西只要不是用的需要一些特别的指令都没问题我试着装了WindowsXP以及MenuetOS、KolibriOS、TempleOS等等基本上都可以正常运行。 </p><p>
后来我还试了试别的软件比如VMOS好像也是一个基于qemu的虚拟机不过它是ARM指令集的安装的是Android系统在很多时候运行一些有可能有问题的软件很方便。 </p><p>
还有一个是ExaGear是基于Wine制作的它只能在一定程度上运行Windows的程序而且因为它也是跨指令集的其实效率不这么高。 </p><p>
以上我们可以发现手机上的虚拟机基本上都是软件模拟的指令集都不一样想怎么搞虚拟化指令虽然ARM的CPU应该支持硬件虚拟化但是目前我的了解是没发现有类似的软件。</p>
<h2 id="其他平台的虚拟机">
<a href="#其他平台的虚拟机"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 其他平台的虚拟机
</h2>
<p>除了在电脑和手机上的虚拟机还有在浏览器上运行的虚拟机真就JS创造宇宙呗。qemu的作者Fabrice Bellard曾经写过一个叫做<a href="https://bellard.org/jslinux/">JSLinux</a>的项目可以运行比如x86指令集的系统相当厉害。</p>
<h1 id="对虚拟化概念的探索">
<a href="#对虚拟化概念的探索"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 对虚拟化概念的探索
</h1>
<p>说完对虚拟化平台的使用,我觉得虚拟机的概念和实现还是比较神奇的。什么是虚拟机?我觉得应该只要是在逻辑上提供运算及存储资源的东西都可以称作是虚拟机,包括人也可以作为一种虚拟化平台。我以前听说过一个故事讲的是图灵下国际象棋,他写了一个下国际象棋的程序,但是那时候还没有电脑。于是他自己就模拟电脑的执行方式和朋友下完了象棋。我觉得他在执行这个程序的时候就相当于开了一个虚拟机,在逻辑上构造了一台可以运行他程序的机器,毕竟图灵是人,不是机器,所以我觉得应该可以叫做虚拟机。 </p><p>
但是这么来说的话,只要不是实模式的操作系统我觉得应该都算是虚拟机,因为程序没有真正享用到电脑的所有运算与存储资源,它们的资源都是由操作系统所分配,这么来看操作系统岂不是也是虚拟机?那么这种虚拟机的意义就和实际的虚拟机意义不相符了,我觉得应该再加一些限制条件。 </p><p>
操作系统的特点是BIOS将代码载入到内存中程序的特点则是操作系统将代码载入到内存中。这么来看的话我觉得就可以得出需要BIOS载入代码并提供运算和存储资源的东西应该才能叫虚拟机……但是BIOS又算什么呢……emmmm所以就是这种原因导致了我感觉虚拟机有些哲学。 </p><p>
除此之外还有像沙箱、Docker这些对资源再次分配的程序它们只是进行资源限制但是程序的代码不是由它们载入的……这就更迷了……</p>
<h1 id="未解决的问题">
<a href="#未解决的问题"><svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg></a> 未解决的问题
</h1>
<p>一般我们认为虚拟化是将一台电脑的资源合理分配把一台电脑当作很多台来用但是我听说有一种叫做虚拟化集群的东西可以把一大堆电脑模拟成一台电脑来用。但是这时候我觉得就会有一些问题比如一般程序会有比如进程间通讯之类的功能但是两个进程假如放在了不同的两个电脑它们的通讯岂不是要通过网线正常情况下应该是通过内存进行通讯吧这个速度估计得差几千倍就算是多CPU的服务器之间也是通过总线连接。拿网线连接真的能用吗这就让我对虚拟化集群这个感到有些迷惑不知道那些虚拟化软件是怎么搞的。</p></main>
<small style="display: block">tags: <a rel="category tag" class="p-category" href="/search.html?keyword=%E8%99%9A%E6%8B%9F%E5%8C%96"><em>虚拟化</em></a> - <a rel="category tag" class="p-category" href="/search.html?keyword=%E8%AE%B0%E5%BD%95"><em>记录</em></a> <span style="float: right;"><a href="https://gitlab.com/mayx/mayx.gitlab.io/tree/master/_posts/2020-09-27-vm.md">查看原始文件</a></span></small>
<h4 style="border-bottom: 1px solid #e5e5e5;margin: 2em 0 5px;">推荐文章</h4>
<p id="suggest-container">Loading...</p>
<script>
var suggest = $("#suggest-container");
$.get(BlogAPI + "/suggest?id=/2020/09/27/vm.html&update=" + lastUpdated.valueOf(), function (data) {
if (data.length) {
getSearchJSON(function (search) {
suggest.empty();
var searchMap = {};
for (var i = 0; i < search.length; i++) {
searchMap[search[i].url] = search[i];
}
var tooltip = $('<div class="content-tooltip"></div>').appendTo('body').hide();
for (var j = 0; j < data.length; j++) {
var item = searchMap[data[j].id];
if (item) {
var link = $('<a href="' + item.url + '">' + item.title + '</a>');
var contentPreview = item.content.substring(0, 100);
if (item.content.length > 100) {
contentPreview += "……";
}
link.hover(
function(e) {
tooltip.text($(this).data('content'))
.css({
top: e.pageY + 10,
left: e.pageX + 10
})
.show();
},
function() {
tooltip.hide();
}
).mousemove(function(e) {
tooltip.css({
top: e.pageY + 10,
left: e.pageX + 10
});
}).data('content', contentPreview);
suggest.append(link);
suggest.append(' - ' + item.date + '<br />');
}
}
});
} else {
suggest.html("暂无推荐文章……");
}
});
</script>
<br />
<div class="pagination">
<span class="prev">
<a href="/2020/09/10/site.html">
上一篇:如何建立一个校园内部网站
</a>
</span>
<br />
<span class="next">
<a href="/2020/10/24/try.html">
下一篇Mayx的产品测评
</a>
</span>
</div>
<!--[if !IE]> -->
<link rel="stylesheet" href="/assets/css/gitalk.css">
<script src="/assets/js/gitalk.min.js"></script>
<div id="gitalk-container"></div>
<script>
var gitalk = new Gitalk({
clientID: '36557aec4c3cb04f7ac6',
clientSecret: 'ac32993299751cb5a9ba81cf2b171cca65879cdb',
repo: 'mabbs.github.io',
owner: 'Mabbs',
admin: ['Mabbs'],
id: '/2020/09/27/vm', // Ensure uniqueness and length less than 50
distractionFreeMode: false, // Facebook-like distraction free mode
proxy: "https://cors-anywhere.mayx.eu.org/?https://github.com/login/oauth/access_token"
})
gitalk.render('gitalk-container')
</script>
<!-- <![endif]-->
</section>
<!--[if !IE]> -->
<div id="landlord" style="left:5px;bottom:0px;">
<div class="message" style="opacity:0"></div>
<canvas id="live2d" width="500" height="560" class="live2d"></canvas>
<div class="live_talk_input_body">
<form id="live_talk_input_form">
<div class="live_talk_input_name_body" >
<input type="checkbox" id="load_this" />
<input type="hidden" id="post_id" value="/2020/09/27/vm.html" />
<label for="load_this">
<span style="font-size: 11px; color: #fff;">&#160;想问这篇文章</span>
</label>
</div>
<div class="live_talk_input_text_body">
<input name="talk" type="text" class="live_talk_talk white_input" id="AIuserText" autocomplete="off" placeholder="要和我聊什么呀?" />
<button type="submit" class="live_talk_send_btn" id="talk_send">发送</button>
</div>
</form>
</div>
<input name="live_talk" id="live_talk" value="1" type="hidden" />
<div class="live_ico_box" style="display:none;">
<div class="live_ico_item type_info" id="showInfoBtn"></div>
<div class="live_ico_item type_talk" id="showTalkBtn"></div>
<div class="live_ico_item type_music" id="musicButton"></div>
<div class="live_ico_item type_youdu" id="youduButton"></div>
<div class="live_ico_item type_quit" id="hideButton"></div>
<input name="live_statu_val" id="live_statu_val" value="0" type="hidden" />
<audio src="" style="display:none;" id="live2d_bgm" data-bgm="0" preload="none"></audio>
<input id="duType" value="douqilai" type="hidden" />
</div>
</div>
<div id="open_live2d">召唤伊斯特瓦尔</div>
<!-- <![endif]-->
<footer>
<p>
<small>Made with ❤ by Mayx<br />Last updated at 2026-01-01 00:00:18<br /> 总字数614622 - 文章数178 - <a href="/atom.xml" >Atom</a> - <a href="/README.html" >About</a></small>
</p>
</footer>
</div>
<script src="/assets/js/scale.fix.js"></script>
<!--[if !IE]> -->
<script src="/assets/js/main_new.js"></script>
<script src="/Live2dHistoire/live2d/js/live2d.js"></script>
<script src="/Live2dHistoire/live2d/js/message.js"></script>
<!-- <![endif]-->
</body>
</html>