首页 > 系统相关 >linux-vm-tools/ubuntu/24.04 /install.sh

linux-vm-tools/ubuntu/24.04 /install.sh

时间:2024-10-10 20:45:14浏览次数:1  
标签:24.04 xrdp HWE hv vm apt etc install linux

一、

#!/bin/bash

#
# This script is for Ubuntu 22.04 Jammy Jellyfish to download and install XRDP+XORGXRDP via
# source.
#
# Major thanks to: http://c-nergy.be/blog/?p=11336 for the tips.
#

###############################################################################
# Use HWE kernel packages
#
HWE=""
#HWE="-hwe-22.04"

###############################################################################
# Update our machine to the latest code if we need to.
#

if [ "$(id -u)" -ne 0 ]; then
    echo 'This script must be run with root privileges' >&2
    exit 1
fi

apt update && apt upgrade -y

if [ -f /var/run/reboot-required ]; then
    echo "A reboot is required in order to proceed with the install." >&2
    echo "Please reboot and re-run this script to finish the install." >&2
    exit 1
fi

###############################################################################
# XRDP
#

# Install hv_kvp utils
apt install -y linux-tools-virtual${HWE}
apt install -y linux-cloud-tools-virtual${HWE}

# Install the xrdp service so we have the auto start behavior
apt install -y xrdp

systemctl stop xrdp
systemctl stop xrdp-sesman

# Configure the installed XRDP ini files.
# use vsock transport.
sed -i_orig -e 's/port=3389/port=vsock:\/\/-1:3389/g' /etc/xrdp/xrdp.ini
# use rdp security.
sed -i_orig -e 's/security_layer=negotiate/security_layer=rdp/g' /etc/xrdp/xrdp.ini
# remove encryption validation.
sed -i_orig -e 's/crypt_level=high/crypt_level=none/g' /etc/xrdp/xrdp.ini
# disable bitmap compression since its local its much faster
sed -i_orig -e 's/bitmap_compression=true/bitmap_compression=false/g' /etc/xrdp/xrdp.ini

# Add script to setup the ubuntu session properly
if [ ! -e /etc/xrdp/startubuntu.sh ]; then
cat >> /etc/xrdp/startubuntu.sh << EOF
#!/bin/sh
export GNOME_SHELL_SESSION_MODE=ubuntu
export XDG_CURRENT_DESKTOP=ubuntu:GNOME
exec /etc/xrdp/startwm.sh
EOF
chmod a+x /etc/xrdp/startubuntu.sh
fi

# use the script to setup the ubuntu session
sed -i_orig -e 's/startwm/startubuntu/g' /etc/xrdp/sesman.ini

# rename the redirected drives to 'shared-drives'
sed -i -e 's/FuseMountName=thinclient_drives/FuseMountName=shared-drives/g' /etc/xrdp/sesman.ini

# Changed the allowed_users
sed -i_orig -e 's/allowed_users=console/allowed_users=anybody/g' /etc/X11/Xwrapper.config

# Blacklist the vmw module
if [ ! -e /etc/modprobe.d/blacklist-vmw_vsock_vmci_transport.conf ]; then
  echo "blacklist vmw_vsock_vmci_transport" > /etc/modprobe.d/blacklist-vmw_vsock_vmci_transport.conf
fi

#Ensure hv_sock gets loaded
if [ ! -e /etc/modules-load.d/hv_sock.conf ]; then
  echo "hv_sock" > /etc/modules-load.d/hv_sock.conf
fi

# Configure the policy xrdp session
mkdir -p /etc/polkit-1/localauthority/50-local.d/
cat > /etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla <<EOF
[Allow Colord all Users]
Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile
ResultAny=no
ResultInactive=no
ResultActive=yes
EOF

# reconfigure the service
systemctl daemon-reload
systemctl start xrdp

#
# End XRDP
###############################################################################

echo "Install is complete."
echo "Reboot your machine to begin using XRDP."

二、set-vm -vmname "ubuntu-24.04" -EnhancedSessionTransportType HvSocket

标签:24.04,xrdp,HWE,hv,vm,apt,etc,install,linux
From: https://www.cnblogs.com/xinzheng/p/18457098

相关文章

  • Linux的xargs 命令
    一、标准输入与管道命令Unix命令都带有参数,有些命令可以接受"标准输入"(stdin)作为参数。$cat/etc/passwd|greproot上面的代码使用了管道命令(|)。管道命令的作用,是将左侧命令(cat/etc/passwd)的标准输出转换为标准输入,提供给右侧命令(greproot)作为参数。因为grep命令可以接受标......
  • 玩玩虚拟化-KVM
    1、讲在前面(玩这个的心历路程)最近一段时间想玩一些集群之类的东西,学习搞一下K8s,集群啥的,但是我没有多台服务器,如果购买云服务器成本太高,后来想到了买台台式机弄点虚拟机来玩,于是我就在某鱼上淘了台二手台式机(24核+32G+512G+4G显卡),价格1280。后来想到要装虚拟机,我就想到了现在经......
  • VMware Workstation 17.6.1 发布下载,修复 4 个已知问题
    VMwareWorkstation17.6.1发布下载,修复4个已知问题VMwareWorkstation17.6.1ProforWindows&Linux-领先的免费桌面虚拟化软件基于x86的Windows、Linux桌面虚拟化软件请访问原文链接:https://sysin.org/blog/vmware-workstation-17/查看最新版。原创作品,转载请保......
  • VMware Fusion 13.6.1 发布下载,修复 4 个已知问题
    VMwareFusion13.6.1发布下载,修复4个已知问题VMwareFusion13.6.1forMac-领先的免费桌面虚拟化软件适用于基于Intel处理器和搭载Apple芯片的Mac的桌面虚拟化软件请访问原文链接:https://sysin.org/blog/vmware-fusion-13/查看最新版。原创作品,转载请保留出处。......
  • 腾讯通Linux端解决方案:兼容银河麒麟以及统信UOS等国产系统
    一、腾讯通RTX持续使用的核心痛点自腾讯通RTX停止更新并下架官网以来,用户们不得不面对一系列无法解决的关键问题,这些问题对日常办公产生了较大困扰:●国产系统与移动端不可用:腾讯通RTX目前仅兼容Windows和Mac系统,致使用户在国产操作系统及移动设备上无法使用。这不仅降低了工作......
  • 【VMware vSphere】VMware vSphere 9 将有 vLCM 重大改进?
    VMwareExplore2024LasVegas大会现已经结束一段时间了,有关此次大会的所有视频也都上传到了VMwareExploreVideoLibrary,大家如果有兴趣可以点击去查看这些会议的内容。我最近观看了“SimplifiedLifecycleManagementforVMwareCloudFoundationandVMwarevSphere[VCFB......
  • Centos7下非lvm的分区扩容
    Centos7下非lvm的分区扩容(重要)前言:一般在生产环境中,如果需要使用一个分区保存大量的文件,建议的做法是在虚拟化环境中增加一块单独的硬盘,挂载一个单独的分区,比如/data上图我们可以看到sdb整块硬盘 为150G ,但是sdb1的分区只有100G挂载点为/data   ,现在需要把......
  • 【linux开发-Qt】-信号与槽机制
    一、什么是信号与槽机制信号(signal),就是在特定情况下被发射的事件,例如PushButton最常见的信号就是鼠标单击时发射的clicked()信号。槽(Slot)就是对信号响应的函数。槽就是一个函数,与一般的C++函数是一样的,可以定义在类的任何部分(public、private或protected),可以具有任......
  • zabbix7proxy安装部署(基于almalinux9.4)
    一.安装zabbix-proxy1.下载软件仓库rpm-Uvhhttps://repo.zabbix.com/zabbix/7.0/alma/9/x86_64/zabbix-release-7.0-2.el9.noarch.rpmdnfcleanalldnfmakecache2.安装dnfinstall-yzabbix-proxy-mysqlzabbix-sql-scriptszabbix-selinux-policy 二.安装mysql1.下......
  • Linux的常见命令
    查看帮助--help 示例:ls--helpman 示例:manlsman命令查看帮助快捷操作:空格键:显示手册下一屏。enter键:一次滚动一行内容。b:回滚一屏。q:退出man命令。注意:这两个命令都可以查看帮助信息,man的内容会比--help的更全面一些。ls查看文件信息常用参数:-a:显示指定......