这篇稿子是同事总结的,自己存下来学习下,也分享给大家
目录
1 准备工作
设置环境变量LANG,修改语言为英文:
export LANG=C
2 探测OS运行环境
使用systemd-detect-virt确定不是虚拟化环境。
已知的虚拟化技术(systemd 243):
┌──────────┬────────────────┬────────────────────────────────────────────┐
│Type │ ID │ Product │
├──────────┼────────────────┼────────────────────────────────────────────┤
│VM │ qemu │ QEMU software virtualization, without KVM │
│ ├────────────────┼────────────────────────────────────────────┤
│ │ kvm │ Linux KVM kernel virtual machine, with │
│ │ │ whatever software, except Oracle │
│ │ │ Virtualbox │
│ ├────────────────┼────────────────────────────────────────────┤
│ │ zvm │ s390 z/VM │
│ ├────────────────┼────────────────────────────────────────────┤
│ │ vmware │ VMware Workstation or Server, and related │
│ │ │ products │
│ ├────────────────┼────────────────────────────────────────────┤
│ │ microsoft │ Hyper-V, also known as Viridian or Windows │
│ │ │ Server Virtualization │
│ ├────────────────┼────────────────────────────────────────────┤
│ │ oracle │ Oracle VM VirtualBox (historically │
│ │ │ marketed by innotek and Sun Microsystems), │
│ │ │ for legacy and KVM hypervisor │
│ ├────────────────┼────────────────────────────────────────────┤
│ │ xen │ Xen hypervisor (only domU, not dom0) │
│ ├────────────────┼────────────────────────────────────────────┤
│ │ bochs │ Bochs Emulator │
│ ├────────────────┼────────────────────────────────────────────┤
│ │ uml │ User-mode Linux │
│ ├────────────────┼────────────────────────────────────────────┤
│ │ parallels │ Parallels Desktop, Parallels Server │
│ ├────────────────┼────────────────────────────────────────────┤
│ │ bhyve │ bhyve, FreeBSD hypervisor │
│ ├────────────────┼────────────────────────────────────────────┤
│ │ qnx │ QNX hypervisor │
│ ├────────────────┼────────────────────────────────────────────┤
│ │ acrn │ ACRN hypervisor[1] │
├──────────┼────────────────┼────────────────────────────────────────────┤
│Container │ openvz │ OpenVZ/Virtuozzo │
│ ├────────────────┼────────────────────────────────────────────┤
│ │ lxc │ Linux container implementation by LXC │
│ ├────────────────┼────────────────────────────────────────────┤
│ │ lxc-libvirt │ Linux container implementation by libvirt │
│ ├────────────────┼────────────────────────────────────────────┤
│ │ systemd-nspawn │ systemd's minimal container │
│ │ │ implementation, see systemd-nspawn(1) │
│ ├────────────────┼────────────────────────────────────────────┤
│ │ docker │ Docker container manager │
│ ├────────────────┼────────────────────────────────────────────┤
│ │ podman │ Podman[2] container manager │
│ ├────────────────┼────────────────────────────────────────────┤
│ │ rkt │ rkt app container runtime │