ubuntu 默认打开方式

本文详细介绍了Linux环境下不同文件类型与应用程序之间的关联配置方法。通过/etc/gnome/defaults.list文件,可以为各种文件类型指定默认打开的应用程序,如LibreOffice、Evince等。此配置覆盖了文档、电子表格、音频、视频等多种文件格式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

etc/gnome/defaults.list


[Default Applications]
application/csv=libreoffice-calc.desktop
application/excel=libreoffice-calc.desktop
application/msexcel=libreoffice-calc.desktop
application/msword=libreoffice-writer.desktop
application/ogg=rhythmbox.desktop
application/pdf=evince.desktop
application/postscript=evince.desktop
application/rtf=libreoffice-writer.desktop
application/tab-separated-values=libreoffice-calc.desktop
application/vnd.lotus-1-2-3=libreoffice-calc.desktop
application/vnd.ms-excel=libreoffice-calc.desktop
application/vnd.ms-word=libreoffice-writer.desktop
application/vnd.rn-realmedia=totem.desktop
application/vnd.sun.xml.base=libreoffice-base.desktop
application/vnd.sun.xml.calc=libreoffice-calc.desktop
application/vnd.sun.xml.calc.template=libreoffice-calc.desktop
application/vnd.sun.xml.draw=libreoffice-draw.desktop
application/vnd.sun.xml.draw.template=libreoffice-draw.desktop
application/vnd.sun.xml.math=libreoffice-math.desktop
application/vnd.sun.xml.writer=libreoffice-writer.desktop
application/vnd.sun.xml.writer.template=libreoffice-writer.desktop
application/vnd.sun.xml.writer.global=libreoffice-writer.desktop
application/vnd.oasis.opendocument.database=libreoffice-base.desktop
application/vnd.oasis.opendocument.formula=libreoffice-math.desktop
application/vnd.oasis.opendocument.graphics=libreoffice-draw.desktop
application/vnd.oasis.opendocument.graphics-template=libreoffice-draw.desktop
application/vnd.oasis.opendocument.presentation=libreoffice-impress.desktop
application/vnd.oasis.opendocument.presentation-template=libreoffice-impress.desktop
application/vnd.oasis.opendocument.spreadsheet=libreoffice-calc.desktop
application/vnd.oasis.opendocument.spreadsheet-template=libreoffice-calc.desktop
application/vnd.oasis.opendocument.text=libreoffice-writer.desktop
application/vnd.oasis.opendocument.text-template=libreoffice-writer.desktop
application/vnd.oasis.opendocument.text-web=libreoffice-writer.desktop
application/vnd.oasis.opendocument.text-master=libreoffice-writer.desktop
application/vnd.sun.xml.impress=libreoffice-impress.desktop
application/vnd.sun.xml.impress.template=libreoffice-impress.desktop
application/vnd.stardivision.calc=libreoffice-calc.desktop
application/vnd.stardivision.draw=libreoffice-draw.desktop
application/vnd.stardivision.impress=libreoffice-impress.desktop
application/vnd.stardivision.math=libreoffice-math.desktop
application/vnd.stardivision.writer=libreoffice-writer.desktop
application/mspowerpoint=libreoffice-impress.desktop
application/vnd.ms-powerpoint=libreoffice-impress.desktop
application/vnd.wordperfect=libreoffice-writer.desktop
application/wordperfect=libreoffice-writer.desktop
application/vnd.openxmlformats-officedocument.wordprocessingml.document=libreoffice-writer.desktop
application/vnd.openxmlformats-officedocument.wordprocessingml.template=libreoffice-writer.desktop
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet=libreoffice-calc.desktop
application/vnd.openxmlformats-officedocument.spreadsheetml.template=libreoffice-calc.desktop
application/vnd.openxmlformats-officedocument.presentationml.slide=libreoffice-impress.desktop
application/vnd.openxmlformats-officedocument.presentationml.slideshow=libreoffice-impress.desktop
application/vnd.openxmlformats-officedocument.presentationml.presentation=libreoffice-impress.desktop
application/vnd.openxmlformats-officedocument.presentationml.template=libreoffice-impress.desktop
application/x-123=libreoffice-calc.desktop
application/x-abiword=abiword.desktop
application/x-applix-spreadsheet=libreoffice-calc.desktop
application/x-ar=file-roller.desktop
application/x-arj=file-roller.desktop
application/x-audacity-project=audacity.desktop
application/x-bzip-compressed-tar=file-roller.desktop
application/x-bzip=file-roller.desktop
application/x-cbr=evince.desktop
application/x-cbz=evince.desktop
application/x-compressed-tar=file-roller.desktop
application/x-compress=file-roller.desktop
application/x-deb=ubuntu-software-center.desktop
application/x-debian-package=ubuntu-software-center.desktop
application/x-dos_ms_excel=libreoffice-calc.desktop
application/x-ear=file-roller.desktop
application/x-excel=libreoffice-calc.desktop
application/x-extension-m4a=totem.desktop
application/x-extension-mp4=totem.desktop
application/x-flac=rhythmbox.desktop
application/x-glade=glade-3.desktop
application/x-gnumeric=gnumeric.desktop
application/x-gtar=file-roller.desktop
application/x-gzip=file-roller.desktop
application/x-gzpostscript=evince.desktop
application/xhtml+xml=firefox.desktop
application/x-jar=file-roller.desktop
application/x-java-archive=file-roller.desktop
application/x-java-jnlp-file=icedtea-netx-javaws.desktop
application/x-lha=file-roller.desktop
application/x-lhz=file-roller.desktop
application/xls=libreoffice-calc.desktop
application/x-lzop=file-roller.desktop
application/x-matroska=totem.desktop
application/x-mps=libreoffice-calc.desktop
application/x-ms-excel=libreoffice-calc.desktop
application/x-msexcel=libreoffice-calc.desktop
application/x-ogg=rhythmbox.desktop
application/x-oleo=libreoffice-calc.desktop
application/x-perl=gedit.desktop
application/x-planperfect=libreoffice-calc.desktop
application/x-quattropro=libreoffice-calc.desktop
application/x-rar-compressed=file-roller.desktop
application/x-rar=file-roller.desktop
application/x-rpm=file-roller.desktop
application/x-sc=libreoffice-calc.desktop
application/x-shockwave-flash=totem.desktop
application/x-sylk=libreoffice-calc.desktop
application/x-tar=file-roller.desktop
application/x-war=file-roller.desktop
application/x-xbase=libreoffice-calc.desktop
application/x-xls=libreoffice-calc.desktop
application/x-zip-compressed=file-roller.desktop
application/x-zip=file-roller.desktop
application/x-zoo=file-roller.desktop
application/zip=file-roller.desktop
audio/3gpp=totem.desktop
audio/ac3=totem.desktop
audio/AMR=totem.desktop
audio/AMR-WB=totem.desktop
audio/basic=totem.desktop
audio/flac=rhythmbox.desktop
audio/midi=totem.desktop
audio/mp4=totem.desktop
audio/mpeg=totem.desktop
audio/mpegurl=totem.desktop
audio/ogg=rhythmbox.desktop
audio/prs.sid=totem.desktop
audio/vnd.rn-realaudio=totem.desktop
audio/x-ape=totem.desktop
audio/x-flac=rhythmbox.desktop
audio/x-gsm=totem.desktop
audio/x-it=totem.desktop
audio/x-m4a=totem.desktop
audio/x-matroska=totem.desktop
audio/x-mod=totem.desktop
audio/x-mp3=rhythmbox.desktop
audio/x-mpeg=rhythmbox.desktop
audio/x-mpegurl=rhythmbox.desktop
audio/x-ms-asf=totem.desktop
audio/x-ms-asx=totem.desktop
audio/x-ms-wax=totem.desktop
audio/x-ms-wma=totem.desktop
audio/x-musepack=totem.desktop
audio/x-pn-aiff=totem.desktop
audio/x-pn-au=totem.desktop
audio/x-pn-realaudio=totem.desktop
audio/x-pn-realaudio-plugin=totem.desktop
audio/x-pn-wav=totem.desktop
audio/x-pn-windows-acm=totem.desktop
audio/x-realaudio=totem.desktop
audio/x-real-audio=totem.desktop
audio/x-sbc=totem.desktop
audio/x-scpls=rhythmbox.desktop
audio/x-speex=totem.desktop
audio/x-tta=totem.desktop
audio/x-wav=totem.desktop
audio/x-wavpack=totem.desktop
audio/x-vorbis=rhythmbox.desktop
audio/x-vorbis+ogg=rhythmbox.desktop
audio/x-xm=totem.desktop
image/bmp=eog.desktop
image/gif=eog.desktop
image/jpeg=eog.desktop
image/jpg=eog.desktop
image/pjpeg=eog.desktop
image/png=eog.desktop
image/svg+xml=eog.desktop
image/tiff=eog.desktop
image/vnd.rn-realpix=totem.desktop
image/x-bmp=eog.desktop
image/x-gray=eog.desktop
image/x-icb=eog.desktop
image/x-ico=eog.desktop
image/x-png=eog.desktop
image/x-portable-anymap=eog.desktop
image/x-portable-bitmap=eog.desktop
image/x-portable-graymap=eog.desktop
image/x-portable-pixmap=eog.desktop
image/x-psd=gimp.desktop
image/x-xbitmap=eog.desktop
image/x-xpixmap=eog.desktop
inode/directory=nautilus.desktop
misc/ultravox=totem.desktop
multipart/x-zip=file-roller.desktop
text/abiword=abiword.desktop
text/calendar=evolution.desktop
text/comma-separated-values=libreoffice-calc.desktop
text/csv=libreoffice-calc.desktop
text/html=firefox.desktop
text/plain=gedit.desktop
text/richtext=abiword.desktop
text/rtf=libreoffice-writer.desktop
text/spreadsheet=libreoffice-calc.desktop
text/tab-separated-values=libreoffice-calc.desktop
text/x-comma-separated-values=libreoffice-calc.desktop
text/x-chdr=gedit.desktop 改成 geany.desktop 即可,其他类似
text/x-csrc=gedit.desktop
text/x-dtd=gedit.desktop
text/x-java=gedit.desktop
text/mathml=gedit.desktop
text/x-python=gedit.desktop
text/x-sql=gedit.desktop
text/xml=firefox.desktop
video/3gpp=totem.desktop
video/dv=totem.desktop
video/fli=totem.desktop
video/flv=totem.desktop
video/mp2t=totem.desktop
video/mp4=totem.desktop
video/mp4v-es=totem.desktop
video/mpeg=totem.desktop
video/msvideo=totem.desktop
video/ogg=totem.desktop
video/quicktime=totem.desktop
video/vivo=totem.desktop
video/vnd.divx=totem.desktop
video/vnd.rn-realvideo=totem.desktop
video/vnd.vivo=totem.desktop
video/webm=totem.desktop
video/x-anim=totem.desktop
video/x-avi=totem.desktop
video/x-flc=totem.desktop
video/x-fli=totem.desktop
video/x-flic=totem.desktop
video/x-flv=totem.desktop
video/x-m4v=totem.desktop
video/x-matroska=totem.desktop
video/x-mpeg=totem.desktop
video/x-ms-asf=totem.desktop
video/x-ms-asx=totem.desktop
video/x-msvideo=totem.desktop
video/x-ms-wm=totem.desktop
video/x-ms-wmv=totem.desktop
video/x-ms-wmx=totem.desktop
video/x-ms-wvx=totem.desktop
video/x-nsv=totem.desktop
video/x-ogm+ogg=totem.desktop
video/x-theora+ogg=totem.desktop
video/x-totem-stream=totem.desktop
x-content/video-dvd=totem.desktop
x-content/video-vcd=totem.desktop
x-content/video-svcd=totem.desktop
x-content/audio-cdda=rhythmbox-device.desktop
x-content/audio-dvd=banshee-audiocd.desktop
x-content/audio-player=rhythmbox-device.desktop
x-content/image-dcf=shotwell.desktop
x-content/image-picturecd=shotwell.desktop
zz-application/zz-winassoc-xls=libreoffice-calc.desktop
x-scheme-handler/apt=ubuntu-software-center.desktop
x-scheme-handler/http=firefox.desktop
x-scheme-handler/https=firefox.desktop
x-scheme-handler/mailto=thunderbird.desktop





<think>我们正在解决VMware中Ubuntu默认声音设备无法打开的问题。根据引用[3],提到了一个错误信息:"AdeviceIDhasbeenusedthatisoutofrangeforyoursystem",并提供了解决方案。但用户的问题描述是“默认声音设备无法打开”,我们需要更全面的解决方案。根据经验,VMware中Ubuntu声音问题可能涉及多个方面:1.VMware声音服务是否开启2.虚拟机设置中声卡是否启用3.Ubuntu系统中声音设置是否正确4.驱动程序问题由于引用[3]提到了一个具体的错误,我们可以先尝试其中的解决方案,同时结合其他常见解决方法。步骤1:检查虚拟机设置-确保虚拟机设置中的声卡已启用:在VMware中,选择该Ubuntu虚拟机,点击“编辑虚拟机设置”,检查“声卡”设备是否存在且已连接。如果没有,添加声卡设备。步骤2:检查VMware声音服务-在主机(Windows)上,按Win+R,输入services.msc,检查VMwareAudioService是否正在运行。如果没有,启动它。步骤3:在Ubuntu中检查声音设置-在Ubuntu系统中,进入系统设置->声音,检查输出设备是否选择正确(通常应为“内置音频”或类似选项)。-使用命令`alsamixer`在终端中检查音量设置(确保没有静音)。步骤4:重新安装alsa驱动-在Ubuntu终端中运行:```bashsudoapt-getupdatesudoapt-getinstall--reinstallalsa-basepulseaudiosudoalsaforce-reload```然后重启系统。步骤5:如果出现引用[3]中的错误(设备ID超出范围)-解决方案:编辑虚拟机的.vmx文件(在虚拟机目录下),添加或修改以下行:```inisound.virtualDev="hdaudio"sound.fileName="-1"sound.autodetect="TRUE"```或者尝试将`hdaudio`改为其他声卡类型,如`sb16`(但通常hdaudio是推荐的)。步骤6:重启虚拟机-完成上述步骤后,重启虚拟机。如果问题仍然存在,可能需要检查主机声卡驱动是否正常,或者尝试更新VMwareWorkstation到最新版本。注意:引用[1]和引用[2]是关于网络问题的,与声音无关,但我们可以参考其排查思路(比如检查服务、设置等)。根据引用[3]的解决方案,我们特别关注了设备ID超出范围的问题,并提供了修改.vmx文件的方法。由于用户问题描述中没有提到具体的错误信息,所以我们提供了全面的步骤。如果用户在执行过程中遇到具体错误,可以进一步调整解决方案。相关问题:1.如何检查Ubuntu系统中的声音设备?2.VMware中如何添加或移除声卡设备?3.如何修改虚拟机的.vmx配置文件?</think>### VMware Ubuntu 默认声音设备无法打开的解决方案 #### 核心原因分析 该问题通常由以下原因导致: 1. **声卡配置错误**:虚拟机设置中声卡类型不兼容(如引用[3]提到的设备ID超出范围错误) 2. **驱动未启用**:Ubuntu系统未加载正确的音频驱动 3. **服务未启动**:VMware音频服务未运行(类似引用[1]中的网络服务问题) 4. **权限限制**:用户无权限访问音频设备 --- #### 分步解决方案 **第一步:检查虚拟机设置** 1. 关闭Ubuntu虚拟机 2. 在VMware中:`虚拟机设置 > 硬件 > 声卡` - ✅ 确认声卡状态为**已连接** - 🔄 将声卡类型改为 **Intel HD Audio**(兼容性最佳) - 若提示"设备ID超出范围"(如引用[3]),添加以下配置到`.vmx`文件: ```ini sound.virtualDev = "hdaudio" sound.autodetect = "TRUE" ``` **第二步:启动音频服务(主机端)** 1. 在**Windows主机**按 `Win+R` 输入 `services.msc` 2. 启动以下服务并设为自动: - `VMware Audio Service` - `Windows Audio`(主机音频服务) **第三步:Ubuntu系统配置** ```bash # 重新安装音频驱动 sudo apt update sudo apt install --reinstall alsa-base pulseaudio # 强制重载驱动 sudo alsa force-reload # 检查声卡状态(应有输出设备列表) aplay -l # 解除静音(关键步骤!) alsamixer # 按F6选默认设备 → 按M键解除静音 → 按↑调整音量 ``` ![alsamixer界面](https://i.imgur.com/ALSAMIXER.png) *图:使用`alsamixer`解除静音状态* **第四步:验证权限** ```bash # 将用户加入音频组 sudo usermod -aG audio $USER # 检查设备权限 ls -l /dev/snd/* # 应显示rw权限 ``` **第五步:终极修复** 若上述无效,尝试重置音频配置: ```bash # 备份并删除旧配置 mv ~/.config/pulse ~/.config/pulse.bak systemctl --user restart pulseaudio.service ``` --- #### 验证步骤 1. 播放测试音频: ```bash sudo apt install sox play -n synth 5 sine 440 # 应听到440Hz音调 ``` 2. 检查系统设置: - `系统设置 > 声音 > 输出` → 选择 **Built-in Audio** --- #### 故障排除流程图 ```mermaid graph TD A[声音无输出] --> B{VMware声卡设置} B -->|未启用| C[启用Intel HD Audio] B -->|已启用| D{主机服务状态} D -->|服务停止| E[启动VMware Audio服务] D -->|服务正常| F{Ubuntu驱动} F -->|驱动异常| G[重装alsa/pulseaudio] F -->|驱动正常| H{静音状态} H -->|静音| I[alsamixer解除静音] H -->|未静音| J[检查用户权限] ``` > ⚠️ 注意:若使用USB耳机,需在`虚拟机设置 > USB控制器`中启用**USB3.0**并勾选`显示所有USB输入设备` --- ### 相关问题 1. 如何诊断Ubuntu中的音频设备驱动问题? 2. VMware虚拟机哪些硬件设置容易导致设备兼容性问题? 3. 除了声音问题,VMware虚拟机还有哪些常见外设故障的解决方法? 4. 如何在无图形界面的Ubuntu服务器中配置音频输出? [^1]: VMware服务未运行导致设备异常 [^3]: 声卡设备ID超出系统范围错误
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值