从AMI镜像恢复AWS Amazon Linux 2实例碰到的VNC服务以及Chrome浏览器无法启动的问题

文章目录

  • 小结
  • 问题及解决
    • VNC服务无法启动
    • `Chrome`浏览器无法启动
  • 参考

小结

Amazon Linux 2保存为AMI (Amazon Machine Images)后,恢复成EC2 Instance (实例)后,VNC服务以及Chrome浏览器无法启动,进行了解决。

问题及解决

如果要将一个EC2 Instance (实例)从一个VPC (Virtual Private Cloud)中迁移到另一个 VPC中,需要将EC2 Instance (实例)保存为AMI (Amazon Machine Images),再从另一个 VPC恢复这个实例。进行了此操作后,恢复后的大部分功能直接使用,但是碰到了VNC服务以及Chrome浏览器无法启动的问题。

VNC服务无法启动

报以下错误:

[ec2-user@ip-100-92-28-119 ~]$ sudo systemctl status vncserver@:1
● vncserver@:1.service - Remote desktop service (VNC)
   Loaded: loaded (/etc/systemd/system/vncserver@.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Mon 2023-12-25 13:17:27 UTC; 2min 13s ago
  Process: 10111 ExecStart=/usr/bin/vncserver_wrapper ec2-user %i (code=exited, status=2)
  Process: 10108 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
 Main PID: 10111 (code=exited, status=2)

Dec 25 13:17:27 ip-100-92-28-119 systemd[1]: Starting Remote desktop service (VNC)...
Dec 25 13:17:27 ip-100-92-28-119 systemd[1]: Started Remote desktop service (VNC).
Dec 25 13:17:27 ip-100-92-28-119 vncserver_wrapper[10111]: Warning: ip-100-92-28-119:1 is taken because of /tmp/.X11-unix/X1
Dec 25 13:17:27 ip-100-92-28-119 vncserver_wrapper[10111]: Remove this file if there is no X server ip-100-92-28-119:1
Dec 25 13:17:27 ip-100-92-28-119 vncserver_wrapper[10111]: A VNC server is already running as :1
Dec 25 13:17:27 ip-100-92-28-119 systemd[1]: vncserver@:1.service: main process exited, code=exited, status=2/INVALIDARGUMENT
Dec 25 13:17:27 ip-100-92-28-119 vncserver_wrapper[10111]: FATAL: 'runuser -l ec2-user' failed!
Dec 25 13:17:27 ip-100-92-28-119 systemd[1]: Unit vncserver@:1.service entered failed state.
Dec 25 13:17:27 ip-100-92-28-119 systemd[1]: vncserver@:1.service failed.

解决办法,删除旧有的导致服务锁定的一些文件,例如使用以下办法解决了问题:

[ec2-user@ip-100-92-28-119 ~]$ sudo rm -rf /tmp/.X11-unix/X2 
[ec2-user@ip-100-92-28-119 ~]$ sudo systemctl start vncserver@:1
[ec2-user@ip-100-92-28-119 ~]$ sudo systemctl status vncserver@:1
● vncserver@:1.service - Remote desktop service (VNC)
   Loaded: loaded (/etc/systemd/system/vncserver@.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2023-12-25 13:22:28 UTC; 3s ago
  Process: 12823 ExecStartPre=/bin/sh -c /usr/bin/vncserver -kill %i > /dev/null 2>&1 || : (code=exited, status=0/SUCCESS)
 Main PID: 12826 (vncserver_wrapp)
   CGroup: /system.slice/system-vncserver.slice/vncserver@:1.service
           ├─12826 /bin/sh /usr/bin/vncserver_wrapper ec2-user :1
           └─13108 sleep 0.1

Dec 25 13:22:28 ip-100-92-28-119 systemd[1]: Starting Remote desktop service (VNC)...
Dec 25 13:22:28 ip-100-92-28-119 systemd[1]: Started Remote desktop service (VNC).
Dec 25 13:22:32 ip-100-92-28-119 vncserver_wrapper[12826]: New 'ip-100-92-28-119:1 (ec2-user)' desktop is ip-100-92-28-119:1
Dec 25 13:22:32 ip-100-92-28-119 vncserver_wrapper[12826]: Starting applications specified in /home/ec2-user/.vnc/xstartup
Dec 25 13:22:32 ip-100-92-28-119 vncserver_wrapper[12826]: Log file is /home/ec2-user/.vnc/ip-100-92-28-119:1.log

Chrome浏览器无法启动

由于旧有的AMI (Amazon Machine Images)里面遗留的用户信息,Chrome浏览器无法启动,报以下错误:

[ec2-user@ip-100-92-28-119 ~]$ /usr/bin/chromium-browser 
*** longjmp causes uninitialized stack frame ***: /usr/lib64/chromium-browser/chromium-browser --enable-plugins --enable-extensions --enable-user-scripts --enable-printing --enable-gpu-rasterization --enable-sync --auto-ssl-client-auth terminated
[1225/134002.778959:ERROR:file_io_posix.cc(145)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
[1225/134002.778999:ERROR:file_io_posix.cc(145)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
[604:604:1225/134002.834881:ERROR:process_singleton_posix.cc(353)] The profile appears to be in use by another Chromium process (14895) on another computer (ip-10-0-3-241.ap-southeast-1.compute.internal). Chromium has locked the profile so that it doesn't get corrupted. If you are sure no other processes are using this profile, you can unlock the profile and relaunch Chromium.
[604:604:1225/134002.834965:ERROR:message_box_dialog.cc(146)] Unable to show a dialog outside the UI thread message loop: Chromium - The profile appears to be in use by another Chromium process (14895) on another computer (ip-10-0-3-241.ap-southeast-1.compute.internal). Chromium has locked the profile so that it doesn't get corrupted. If you are sure no other processes are using this profile, you can unlock the profile and relaunch Chromium.

进行以下操作删除旧有用户信息也就是Singleton*相关文件,可以解决问题:

[ec2-user@ip-100-92-28-119 chromium]$ pwd
/home/ec2-user/.config/chromium
[ec2-user@ip-100-92-28-119 chromium]$ 
[ec2-user@ip-100-92-28-119 chromium]$ ls
AutofillStates         Crash Reports           Dictionaries                 FirstPartySetsPreloaded  hyphen-data   NativeMessagingHosts      PKIMetadata                          segmentation_platform  SingletonSocket   
BrowserMetrics         Crowd Deny              FileTypePolicies             First Run                Last Version  OnDeviceHeadSuggestModel  PrivacySandboxAttestationsPreloaded  ShaderCache            SSLErrorAssistant 
CertificateRevocation  Default                 first_party_sets.db          GraphiteDawnCache        Local State   OptimizationHints         Safe Browsing                        SingletonCookie        Subresource Filter
component_crx_cache    DeferredBrowserMetrics  first_party_sets.db-journal  GrShaderCache            MEIPreload    OriginTrials              SafetyTips                           SingletonLock          TpcdMetadata      
[ec2-user@ip-100-92-28-119 chromium]$ rm -rf Singleton*

可以正常启动chromium-browser

[ec2-user@ip-100-92-28-119 ~]$ /usr/bin/chromium-browser 
*** longjmp causes uninitialized stack frame ***: /usr/lib64/chromium-browser/chromium-browser --enable-plugins --enable-extensions --enable-user-scripts --enable-printing --enable-gpu-rasterization --enable-sync --auto-ssl-client-auth terminated
[1225/134932.848548:ERROR:file_io_posix.cc(145)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
[1225/134932.848588:ERROR:file_io_posix.cc(145)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
[6597:6597:1225/134932.975664:ERROR:policy_logger.cc(156)] :components/enterprise/browser/controller/chrome_browser_cloud_management_controller.cc(161) Cloud management controller initialization aborted as CBCM is not enabled. Please use the `--enable-chrome-browser-cloud-management` command line flag to enable it if you are not using the official Google Chrome build.
[6638:6638:1225/134933.236481:ERROR:viz_main_impl.cc(196)] Exiting GPU process due to errors during initialization
[6597:6702:1225/134933.260061:ERROR:object_proxy.cc(577)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[6597:6702:1225/134933.260347:ERROR:object_proxy.cc(577)] Failed to call method: org.freedesktop.UPower.GetDisplayDevice: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[6597:6702:1225/134933.260617:ERROR:object_proxy.cc(577)] Failed to call method: org.freedesktop.UPower.EnumerateDevices: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[6703:6703:1225/134933.398015:ERROR:viz_main_impl.cc(196)] Exiting GPU process due to errors during initialization
[6673:25:1225/134933.463239:ERROR:command_buffer_proxy_impl.cc(127)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.
[ec2-user@ip-100-92-28-119 ~]$ /usr/bin/chromium-browser 
*** longjmp causes uninitialized stack frame ***: /usr/lib64/chromium-browser/chromium-browser --enable-plugins --enable-extensions --enable-user-scripts --enable-printing --enable-gpu-rasterization --enable-sync --auto-ssl-client-auth terminated
[1226/104833.800228:ERROR:file_io_posix.cc(145)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
[1226/104833.800269:ERROR:file_io_posix.cc(145)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
[25423:25423:1226/104833.930465:ERROR:policy_logger.cc(156)] :components/enterprise/browser/controller/chrome_browser_cloud_management_controller.cc(161) Cloud management controller initialization aborted as CBCM is not enabled. Please use the `--enable-chrome-browser-cloud-management` command line flag to enable it if you are not using the official Google Chrome build.
[25423:25513:1226/104834.192655:ERROR:object_proxy.cc(577)] Failed to call method: org.freedesktop.DBus.Properties.Get: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[25423:25513:1226/104834.193197:ERROR:object_proxy.cc(577)] Failed to call method: org.freedesktop.UPower.GetDisplayDevice: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[25423:25513:1226/104834.193375:ERROR:object_proxy.cc(577)] Failed to call method: org.freedesktop.UPower.EnumerateDevices: object_path= /org/freedesktop/UPower: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
[25461:25461:1226/104834.196267:ERROR:viz_main_impl.cc(196)] Exiting GPU process due to errors during initialization
[25489:27:1226/104834.266593:ERROR:command_buffer_proxy_impl.cc(127)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer.


效果如下:
chrome browser

参考

chromium.org: Issue 367048: Cannot start chrome after changing hostname
askubuntu.com: “Your profile could not be opened correctly.” while opening Chrome(ium)
forums.fedoraforum.org: VNC Server Warning: localhost:1 is taken because of /tmp/.X1-lock

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/272044.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

Redis分布式缓存之主从哨兵分片集群

Redis主从 数据同步原理 Redis哨兵 Redis分片集群 集群伸缩:在集群中插入或删除某个节点 集群故障转移

HubSpot到底好不好用?

HubSpot被认为是一款强大的综合营销平台,然而,其是否适合你的业务取决于多种因素。以下是一些关于HubSpot的优点和考虑因素: HubSpot的优点: 一体化平台: HubSpot集成了营销、销售和服务功能,使得企业可以…

excel统计分析——CVM正态性检验

参考资料:统计推断——正态性检验(图形方法、偏度和峰度、统计(拟合优度)检验)_sm.distributions.ecdf-CSDN博客 29_张达成_从经验过程出发建立 Cramer-von Mises 统计量的性质 - 豆丁网 https://cran.r-project.org…

LeetCode 每日一题 Day 24(Hard) ||dp动态规划

1349. 参加考试的最大学生数 给你一个 m * n 的矩阵 seats 表示教室中的座位分布。如果座位是坏的(不可用),就用 ‘#’ 表示;否则,用 ‘.’ 表示。 学生可以看到左侧、右侧、左上、右上这四个方向上紧邻他的学生的答…

解析d3dx9_43.dll文件,有效修复d3dx9_43.dll文件丢失

最近有小伙伴给小编反映说他的电脑老是出现d3dx9_43.dll文件丢失的问题,问为啥会这样?要怎么解决?那么今天小编就来给大家详细的解析这个d3dx9_43.dll文件吧,同时教大家如何去进行修复。 一. d3dx11_43.dll是什么文件有啥用 1.d3…

【数据库系统概论】第3章-关系数据库标准语言SQL(3)

文章目录 3.5 数据更新3.5.1 插入数据3.5.2 修改数据3.5.3 删除数据 3.6 空值的处理3.7 视图3.7.1 建立视图3.7.2 查询视图3.7.3 更新视图3.7.4 视图的作用 3.5 数据更新 3.5.1 插入数据 注意:插入数据时要满足表或者列的约束条件,否则插入失败&#x…

SpringBoot整合jwt(小白入门)

本文项目所用版本为: https://blog.csdn.net/weixin_39570751/article/details/133386557 代码仓库: https://gitee.com/skyblue0678/springboot-demo 目录 什么是JWT JWT依赖 写一个jwt工具类 测试一下jwt 优化:将过期时间配置在文件中 答疑&…

mysql根据条件修改字段

数据 sql语句 根据field2 字段情况,修改field1字段 update t1 tt1 set tt1.field1 ( case when tt1.field2 in (我家2) then 1111 when tt1.field2 in (你的家11) then 2222 else tt1.field2 end )结果

ros2+python,报错:`GLIBCXX_3.4.30‘ not found

在执行代码import rclpy,出现如下图所示报错 如报错信息所示,/home/shui/miniconda3/envs/ros2/bin/…/lib/libstdc.so.6中没有找到GLIBCXX_3.4.30’ 检查/home/shui/miniconda3/envs/ros2/bin/…/lib/的libstdc.so.6文件 cd /home/shui/miniconda3/e…

7. Resource database in UVM(UVM的资源数据库)

UVM集中资源数据库用于存储可配置(configurable)对象/object、变量/variables、虚拟接口/virtual interfaces、队列/queues、类句柄/class handles等,并从数据库中检索它们。这种可配置的测试平台为验证工程师提供了一定程度的自由度&#xf…

sqlmap各个命令的解释及其基本用法

各个命令的用法 -h,--help Show basic help message and exit(显示基本帮助消息并退出) -hh Show advanced help message and exit(显示高级帮助信息并退出) --version Show programs version number and exit(显示程序的版本…

【Vue UI组件库】

Vue UI组件库 1 移动端常用UI组件库2 PC端常用UI组件库2.1 Element UI 1 移动端常用UI组件库 Vant:https://youzan.github.io/vantCube UI:https://didi.github.io/cube-uiMint UI:http://mint-ui.github.io 2 PC端常用UI组件库 Element U…

带你学C语言~指针(3)

目录 ✍0.前言 🚀1.字符指针变量 🚅2.数组指针变量 🐱‍🏍2.1.数组指针变量是什么 🐱‍🏍2.2数组指针变量怎么初始化 🚢3.二维数组传参的本质 🚀4.函数指针变量 ✈4.1函数指…

Ubuntu-22.04编译安装FLTK

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录 前言一、FLTK是什么?二、下载源代码三、准备编译环境四、编译五、运行测试程序六、Demo总结 前言 最近在研究FLTK,突然对它感了兴趣&#x…

猫粮选择困难?5款性价比高的主食冻干品牌推荐

近年来,冻干猫粮作为热门的高品质猫粮,受到了许多追求纯天然、健康食品的铲屎官的关注。萌新铲屎官就很疑惑了冻干猫粮可以代替猫粮作为主食吗?冻干猫粮真就那么好吗? 那么今天作为一个宠物店店长,跟大家一起聊聊各种…

UG模型的显示与隐藏

在UG中,除了通过图层的方式控制模型的显示与隐藏外,还可以直接通过显示与隐藏命令,位置在菜单-编辑-显示与隐藏,需要注意的是这些命令只能对可视图层中的模型进行控制 显示与隐藏:ctrl w 可以通过模型的类别&#xf…

系统架构设计师笔记

第1章计算机组成与体系结构 1.1.1计算机硬件的组成 (1)控制器。控制器是分析和执行指令的部件,也是统一指挥并控制计算机各部件协调工作的中心部件,所依据的是机器指令。控制器的组成包含如下。 ①程序计数器PC:存储下…

忻府区政协主席郭新和带队视察洁晋发电环保教育基地中国流动科技博物馆展厅

忻府区政协主席郭新和带队视察洁晋发电环保教育基地中国流动科技博物馆展厅 2023年12月5日,忻府区政协主席郭新和带队视察中国流动科技博物馆展览情况。 郭新和一行来到位于忻州市洁晋发电有限公司环保教育基地的中国流动科技馆忻府区展厅。展厅内配备了科普知识展…

2023 年备受瞩目的向量数据库赛道盘点出炉

近日,Zilliz 捷报频传,先后斩获来自极客公园、量子位、界面科技、OSCHINA 等行业头部媒体所颁发的奖项以及荣登相应榜单。 接下来,就让我们一起来了解一下这些颇受业界认可的奖项及榜单~ 2023 中国创新力量 50 榜单 【2023 中国创…

托盘在线缠绕机

托盘在线式缠绕机是适应流水线作业的包装机械,很适合现代化企业的自动化包装的需要,对提高包装效率,降低劳动强度,有效利用人力资源,起到较好的作用。目前,托盘在线缠绕机已经在化工、电子、食品、饮料、造…