多谢邀请, 却之不恭。
如果硬盘能挤出 64GB 的空间, 装个 LINUX 虚拟机(例如 FEDORA 34/35)是最简单划算的。一般来说, 便宜的 VPS 也是这样的配置。玩熟了转战 VPS 也比较顺滑。64GB 的空间其实都有点多了,20GB/40GB 装 CENTOS 6/7 都是很够用的, 只是它们有点老了。
您可以在 LINUX 下,装 LINUX 虚拟机; 也可以在 Windows 下,装 LINUX 虚拟机。俺喜欢 LINUX 多一些, 因此台式机上的 WINDOWS 是跑在 LINUX 下的虚拟机。虚拟机软件用免费的 ORACLE VIRTUAL BOX 6 就可以了。至少俺没发现(个人使用) VMware 比 VirtualBox 有什么太多的优势。显卡的 3D 都不行。VMware 俺觉得也没什么不好。
弄个二手电脑也不是不可以。
二手的笔记本电脑, 俺买过 20 刀的, 也就是 100 人民币的 CORE 2 DUO DELL (2GB内存)笔记本。跑起来 LINUX 的体验不如 AMD RYZEN 5600 上的虚拟机。也许是因为老笔记本舍不得上 SSD 的原因。值得留意的是,有些硬件的实验,确实是有个真家伙的电脑比较好玩。比如串行口、并行口的通信实验( NULL MODEM刷卫星接收机路由器等), 调试些古老的单片机的套件,wifi 抓包...... 实际上毕业离校的师兄姐打算扔杂的笔记本电脑, 您厚脸皮问一句说不定就有免费的。这些电脑一般会有屏幕碎裂、少键/失灵/键帽无字/极脏、触摸板很油腻、电池失效等等毛病,洗洗修修或者当 HEADLESS SERVER 用也是无妨。
俺觉得装个虚拟机跟装个游戏没多大的区别。
近年来大家遇到的,稍微麻烦的可能是某些驱动(所谓核心模块 KO)要签名。
举个例子
最近LINUX 核心升级以后,
您可能会发现 LINUX 装不上 VMware Workstation 16。 这问题在网上也经常看到讨论。
在俺手贱升级了 FEDORA 包括核心之后,原先好端端的 VMware Workstation 16 (FOR LINUX) 启动不了。手动签名也签不了。
重新默认安装 VMware Workstation 16 (FOR LINUX)以后问题依旧存在,就启动不了。
好在经过一番挣扎,
俺还是找到了一个暂时性的解决办法。
备注:下面这是 “1条” 命令 #CPATH=/usr/src/kernels/5.16.14-200.fc35.x86_64/include/linux vmware-modconfig --console --install-all
安装来讲, 无疑是十分简单的
[wenxue@dad5600 ~]$ chmod +x VMware-Workstation-Full-16.2.3-19376536.x86_64.bundle [wenxue@dad5600 ~]$ sudo ./VMware-Workstation-Full-16.2.3-19376536.x86_64.bundle Extracting VMware Installer...done. Installing VMware Workstation 16.2.3 Configuring... [######################################################################] 100% Installation was successful.
俺确认的 “QUICK FIX”(快修)就是在默认安装以后,手工加入VM WORKSTATION 的 KO 编译需要用到的环境变量 CPATH 的值。
自行定义目前所用的LINUX 核心源码的路径:
CPATH=/usr/src/kernels/5.16.14-200.fc35.x86_64/include/linux
或者用 EXPORT (注意: 只影响当前终端窗口)
export CPATH=/usr/src/kernels/5.16.14-200.fc35.x86_64/include/linux 或者 export CPATH=/usr/src/kernels/$(uname -r)/include/linux 或者 export CPATH=/usr/src/kernels/`uname -r`/include/linux vmware-modconfig --console --install-all
# cd /usr/src/ debug/ kernels/ vboxhost-6.1.32/ [root@dad5600 src]# [root@dad5600 src]# find . -name stdarg.h -type f ./kernels/5.16.14-200.fc35.x86_64/include/linux/stdarg.h [root@dad5600 src]# [root@dad5600 src]# CPATH=/usr/src/kernels/5.16.14-200.fc35.x86_64/include/linux vmware-modconfig --console --install-all [AppLoader] GLib does not have GSettings support. Stopping vmware (via systemctl): [ OK ] make: Entering directory '/tmp/modconfig-plg7sL/vmmon-only' Using kernel build system. /usr/bin/make -C /lib/modules/5.16.14-200.fc35.x86_64/build/include/.. M=$PWD SRCROOT=$PWD/. MODULEBUILDDIR= modules make[1]: Entering directory '/usr/src/kernels/5.16.14-200.fc35.x86_64' CC [M] /tmp/modconfig-plg7sL/vmmon-only/linux/driver.o CC [M] /tmp/modconfig-plg7sL/vmmon-only/linux/driverLog.o CC [M] /tmp/modconfig-plg7sL/vmmon-only/linux/hostif.o CC [M] /tmp/modconfig-plg7sL/vmmon-only/common/apic.o CC [M] /tmp/modconfig-plg7sL/vmmon-only/common/comport.o CC [M] /tmp/modconfig-plg7sL/vmmon-only/common/cpuid.o CC [M] /tmp/modconfig-plg7sL/vmmon-only/common/crosspage.o CC [M] /tmp/modconfig-plg7sL/vmmon-only/common/memtrack.o CC [M] /tmp/modconfig-plg7sL/vmmon-only/common/moduleloop.o CC [M] /tmp/modconfig-plg7sL/vmmon-only/common/phystrack.o CC [M] /tmp/modconfig-plg7sL/vmmon-only/common/sharedAreaVmmon.o CC [M] /tmp/modconfig-plg7sL/vmmon-only/common/statVarsVmmon.o CC [M] /tmp/modconfig-plg7sL/vmmon-only/common/task.o /tmp/modconfig-plg7sL/vmmon-only/common/phystrack.o: warning: objtool: PhysTrack_Free() falls through to next function PhysTrack_Add() /tmp/modconfig-plg7sL/vmmon-only/common/phystrack.o: warning: objtool: PhysTrack_Add() falls through to next function PhysTrack_Remove() /tmp/modconfig-plg7sL/vmmon-only/common/phystrack.o: warning: objtool: PhysTrack_Remove() falls through to next function PhysTrack_Test() CC [M] /tmp/modconfig-plg7sL/vmmon-only/common/vmx86.o CC [M] /tmp/modconfig-plg7sL/vmmon-only/bootstrap/bootstrap.o CC [M] /tmp/modconfig-plg7sL/vmmon-only/bootstrap/monLoader.o CC [M] /tmp/modconfig-plg7sL/vmmon-only/bootstrap/monLoaderVmmon.o CC [M] /tmp/modconfig-plg7sL/vmmon-only/bootstrap/vmmblob.o /tmp/modconfig-plg7sL/vmmon-only/common/task.o: warning: objtool: .text: unexpected end of section LD [M] /tmp/modconfig-plg7sL/vmmon-only/vmmon.o MODPOST /tmp/modconfig-plg7sL/vmmon-only/Module.symvers CC [M] /tmp/modconfig-plg7sL/vmmon-only/vmmon.mod.o LD [M] /tmp/modconfig-plg7sL/vmmon-only/vmmon.ko BTF [M] /tmp/modconfig-plg7sL/vmmon-only/vmmon.ko Skipping BTF generation for /tmp/modconfig-plg7sL/vmmon-only/vmmon.ko due to unavailability of vmlinux make[1]: Leaving directory '/usr/src/kernels/5.16.14-200.fc35.x86_64' /usr/bin/make -C $PWD SRCROOT=$PWD/. MODULEBUILDDIR= postbuild make[1]: Entering directory '/tmp/modconfig-plg7sL/vmmon-only' make[1]: 'postbuild' is up to date. make[1]: Leaving directory '/tmp/modconfig-plg7sL/vmmon-only' cp -f vmmon.ko ./../vmmon.o make: Leaving directory '/tmp/modconfig-plg7sL/vmmon-only' make: Entering directory '/tmp/modconfig-plg7sL/vmnet-only' Using kernel build system. /usr/bin/make -C /lib/modules/5.16.14-200.fc35.x86_64/build/include/.. M=$PWD SRCROOT=$PWD/. MODULEBUILDDIR= modules make[1]: Entering directory '/usr/src/kernels/5.16.14-200.fc35.x86_64' CC [M] /tmp/modconfig-plg7sL/vmnet-only/driver.o CC [M] /tmp/modconfig-plg7sL/vmnet-only/hub.o CC [M] /tmp/modconfig-plg7sL/vmnet-only/userif.o CC [M] /tmp/modconfig-plg7sL/vmnet-only/netif.o CC [M] /tmp/modconfig-plg7sL/vmnet-only/bridge.o CC [M] /tmp/modconfig-plg7sL/vmnet-only/procfs.o CC [M] /tmp/modconfig-plg7sL/vmnet-only/smac_compat.o CC [M] /tmp/modconfig-plg7sL/vmnet-only/smac.o CC [M] /tmp/modconfig-plg7sL/vmnet-only/vnetEvent.o CC [M] /tmp/modconfig-plg7sL/vmnet-only/vnetUserListener.o /tmp/modconfig-plg7sL/vmnet-only/hub.c:237:24: warning: argument 1 of type ‘uint8[]’ {aka ‘unsigned char[]’} with mismatched bound [-Warray-parameter=] 237 | VNetHub_AllocPvn(uint8 id[]) // IN: the PVN ID to alloc on | ~~~~~~^~~~ In file included from /tmp/modconfig-plg7sL/vmnet-only/hub.c:43: /tmp/modconfig-plg7sL/vmnet-only/vnetInt.h:173:34: note: previously declared as ‘uint8[20]’ {aka ‘unsigned char[20]’} 173 | VNetJack *VNetHub_AllocPvn(uint8 id[VNET_PVN_ID_LEN]); | ~~~~~~^~~~~~~~~~~~~~~~~~~ /tmp/modconfig-plg7sL/vmnet-only/hub.c:261:20: warning: argument 3 of type ‘uint8[]’ {aka ‘unsigned char[]’} with mismatched bound [-Warray-parameter=] 261 | uint8 id[]) // IN: PVN ID to use (NULL if allocPvn == FALSE) | ~~~~~~^~~~ /tmp/modconfig-plg7sL/vmnet-only/hub.c:68:37: note: previously declared as ‘uint8[20]’ {aka ‘unsigned char[20]’} 68 | uint8 id[VNET_PVN_ID_LEN]); | ~~~~~~^~~~~~~~~~~~~~~~~~~ /tmp/modconfig-plg7sL/vmnet-only/driver.c: In function ‘VNetFileOpUnlockedIoctl’: /tmp/modconfig-plg7sL/vmnet-only/driver.c:966:7: warning: this statement may fall through [-Wimplicit-fallthrough=] 966 | { | ^ /tmp/modconfig-plg7sL/vmnet-only/driver.c:976:4: note: here 976 | case SIOCGETAPIVERSION: | ^~~~ LD [M] /tmp/modconfig-plg7sL/vmnet-only/vmnet.o MODPOST /tmp/modconfig-plg7sL/vmnet-only/Module.symvers CC [M] /tmp/modconfig-plg7sL/vmnet-only/vmnet.mod.o LD [M] /tmp/modconfig-plg7sL/vmnet-only/vmnet.ko BTF [M] /tmp/modconfig-plg7sL/vmnet-only/vmnet.ko Skipping BTF generation for /tmp/modconfig-plg7sL/vmnet-only/vmnet.ko due to unavailability of vmlinux make[1]: Leaving directory '/usr/src/kernels/5.16.14-200.fc35.x86_64' /usr/bin/make -C $PWD SRCROOT=$PWD/. MODULEBUILDDIR= postbuild make[1]: Entering directory '/tmp/modconfig-plg7sL/vmnet-only' make[1]: 'postbuild' is up to date. make[1]: Leaving directory '/tmp/modconfig-plg7sL/vmnet-only' cp -f vmnet.ko ./../vmnet.o make: Leaving directory '/tmp/modconfig-plg7sL/vmnet-only'
就这么弄一下, VMware Workstation 16 又可以用了。 (备注: 没事别整天 UPDATE)
当然, 如果 KO 要签名的话, 别忘记自行签名。证书可用自己的私房证书。(注意这个证书要事先用 mokutil 导入自己的电脑主板)
mokutil --import /证书路径/您的证书.der 【记得重启电脑,会自动进入一个主板的菜单】
举例 (包括签名的脚本内容)
[root@dad5600 signed-modules]# ls MOKDADvb.der MOKDADvb.priv MOKdadVM.der MOKdadVM.priv sign-virtual-box sign-vmware-vmm [root@dad5600 signed-modules]# cat ./sign-vmware-vmm #!/bin/bash for modfile in $(dirname $(modinfo -n vmmon))/*.ko; do echo "Signing $modfile" /usr/src/kernels/$(uname -r)/scripts/sign-file sha256 /root/signed-modules/MOKDADvb.priv /root/signed-modules/MOKDADvb.der "$modfile" done [root@dad5600 signed-modules]# cat ./sign-virtual-box #!/bin/bash for modfile in $(dirname $(modinfo -n vboxdrv))/*.ko; do echo "Signing $modfile" /usr/src/kernels/$(uname -r)/scripts/sign-file sha256 /root/signed-modules/MOKDADvb.priv /root/signed-modules/MOKDADvb.der "$modfile" done [root@dad5600 signed-modules]#
顺便说一下。VIRTUAL BOX 6 的出错也是类似的。
[root@dad5600 signed-modules]# /sbin/vboxconfig vboxdrv.sh: Stopping VirtualBox services. vboxdrv.sh: Starting VirtualBox services. vboxdrv.sh: You must sign these kernel modules before using VirtualBox: vboxdrv vboxnetflt vboxnetadp See the documentation for your Linux distribution.. vboxdrv.sh: Building VirtualBox kernel modules. vboxdrv.sh: failed: modprobe vboxdrv failed. Please use 'dmesg' to find out why. There were problems setting up VirtualBox. To re-start the set-up process, run /sbin/vboxconfig as root. If your system is using EFI Secure Boot you may need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system's documentation for more information.
ref
https://forums.fedoraforum.org/showthread.php?228560-vmlinux-file How To Install KVM on Fedora 35/34/33/32/31 https://computingforgeeks.com/how-to-install-kvm-on-fedora/
..
其实两者并没有本质的冲突, 两个都可以有。
就从免费的(虚拟机)开始吧。
您不会有任何损失。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
..