VM虚拟机安装Ubuntu24.04解决的问题
1. 以非3D图形界面进入系统,不然会黑屏。
进入系统之后:
sudo add-apt-repository ppa:oibaf/graphics-drivers
sudo apt update && sudo apt upgrade
更新图形界面,等待完成,关机再以3D图形界面进入系统。
如果apt-get upgrade 之后出现无法进入系统,在黑屏界面仅有光标闪烁的现象,也可以在恢复模式下以上述命令修复。
2. root登录界面
设置密码:
sudo passwd root
加入AllowRoot=true
vim /etc/gdm3/custom.conf
# TimedLoginDelay = 10
AllowRoot=true
[security]
注释非root用户权限
vim /etc/pam.d/gdm-password
#auth required pam_succeed_if.so user != root quiet_success //注释掉
重启
如果是linuxmint系统,设置好root密码之后,只需要如下修改
sudo vim /etc/lightdm/lightdm.conf
或者:
sudo vim /etc/lightdm/lightdm.conf.d/70-linuxmint.conf
在末尾添加 :
greeter-show-manual-login=true
allow-guest=false

3. pip3 install xxx 报错
sudo mv /usr/lib/python3.x/EXTERNALLY-MANAGED /usr/lib/python3.x/EXTERNALLY-MANAGED.bk
4. 创建nfs服务:
sudo apt install nfs-kernel-server //安装服务
sudo systemctl status nfs-server //确认服务开启
mkdir /nfs_dir //创建nfs目录
chmod 777 /nfs_dir
vim /etc/exports
/nfs_dir 192.168.0.0/24(rw,sync,no_subtree_check) //末尾加入这一行,意思是192.168.0网段共享
sudo exportfs -arv //生效设置
showmount -e //确认是否共享完成
客户机挂载指令:
mount -t nfs -o nolock 192.168.0.151:/nfs_dir /mnt
5. 共享的Windows文件夹会失效:
首先重装vmtools
sudo apt-get update
sudo apt-get install --reinstall open-vm-tools open-vm-tools-desktop
再不行就修改:
vim /root/.bashrc
vmhgfs-fuse .host:/ /mnt/hgfs //末尾加入这一行
如果开机出现错误:
fuse: bad mount point `/mnt/hgfs': No such file or directory
手动创建目录:mkdir -p /mnt/hgfs
chmod 777 /mnt/hgfs
6. 解决使用pip3 install 时出现的"error: externally-managed-environment"方案
在 pip3 install package 后面加上参数 “--break-system-packages”
7. ubuntu网络连接图标消失:
sudo service NetworkManager stop
sudo rm /var/lib/NetworkManager/NetworkManager.state
sudo service NetworkManager start
8. 拷贝的虚拟机经常出现断网情况,或者网络启动失败的问题
有可能是网口的mac地址重复造成冲突,打开vm虚拟机设置选项,网口mac地址重新生成。
9. 开启SSH登录的问题
安装ssh服务
sudo apt update
sudo apt install openssh-server
允许root登录选项打开,vim /etc/ssh/sshd_config

service ssh restart //重启
systemctl status ssh //查看启动状态
systemctl enable ssh // 加入开机自启动
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1
sysctl -p //运行重启系统服务
11. 系统报GLIBC_版本错误
Error /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34’ not found
sudo apt install open-vm-tools open-vm-tools-desktop
apt autoremove firefox thunderbird pix rhythmbox celluloid libreoffice* hypnotix timeshift transmission-gtk drawing thingy simple-scan xfce4-dict xfce4-screenshooter qt5ct warpinator hexchat webapp-manager pulseaudio
apt autoclean
14. pip永久换源
mkdir -p ~/.config/pip
vim ~/.config/pip/pip.conf
增加以下内容
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = pypi.tuna.tsinghua.edu.cn

浙公网安备 33010602011771号