虚拟机下Ubuntu修改分辨率

来源:互联网 发布:ipadcad cad绘图软件 编辑:程序博客网 时间:2024/06/06 14:11

使用下面的命令可以察看显卡信息
$ lspci | grep VGA

01:00.0 VGA compatible controller: Advanced Micro Devices [AMD] nee ATI RV710 [Mobility Radeon HD 4500/5100 Series]

使用xrandr命令就可以修改分辨率了:
首先,直接运行xrandr查看下分辨率的情况:

xrandr
Screen 0: minimum 1 x 1, current 1366 x 768, maximum 8192 x 8192Virtual1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm   1366x768       60.0*+   2560x1600      60.0     1920x1440      60.0     1856x1392      60.0     1792x1344      60.0     1920x1200      59.9     1600x1200      60.0     1680x1050      60.0     1400x1050      60.0     1280x1024      60.0     1440x900       59.9     1280x960       60.0     1360x768       60.0     1280x800       59.8     1152x864       75.0     1280x768       59.9     1024x768       60.0     800x600        60.3     640x480        59.9     1368x768_60.00   59.9  Virtual2 disconnected (normal left inverted right x axis y axis)Virtual3 disconnected (normal left inverted right x axis y axis)Virtual4 disconnected (normal left inverted right x axis y axis)Virtual5 disconnected (normal left inverted right x axis y axis)Virtual6 disconnected (normal left inverted right x axis y axis)Virtual7 disconnected (normal left inverted right x axis y axis)Virtual8 disconnected (normal left inverted right x axis y axis)

标有星号(*)的那一行就是当前正在使用的分辨率,
接下来使用cvt命令生成一个modeline,为后续添加分辨率作准备:

$ cvt 1440 900# 1440x900 59.89 Hz (CVT 1.30MA) hsync: 55.93 kHz; pclk: 106.50 MHzModeline "1440x900_60.00"  106.50  1440 1528 1672 1904  900 903 909 934 -hsync +vsync

再运行xrandr –newmode来创建一个分辨率模式,使用“Modeline”后的内容(–rmmode删除这个模式):

$ xrandr --newmode "1440x900_60.00" 106.50 1440 1528 1672 1904 900 903 909 934 -hsync +vsync
接着用xrandr –addmode把这个模式添加到显示器上(–delmode把这个模式从该显示器上移除):

$ xrandr --addmode VGA1 "1440x900_60.00"

在这里出现错误,VGA1找不到输出,看xrandr得到的信息
Virtual1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
将输出改为Virtual1解决问题!
最后是应用这个模式:
$ xrandr --output Virtual1 --mode "1440x900_60.00"
OK!设置完成!
用xrandr查看一下:

$ xrandrScreen 0: minimum 320 x 200, current 1440 x 900, maximum 4096 x 4096LVDS1 connected (normal left inverted right x axis y axis)   1024x600       60.0 +   800x600        60.3     56.2    640x480        59.9 VGA1 connected 1440x900+0+0 (normal left inverted right x axis y axis) 0mm x 0mm   1024x768       60.0    800x600        60.3     56.2    848x480        60.0    640x480        59.9    1440x900_60.00   59.9*

设置完成后画面可能出现偏移,直接在显示器上调整就可以了。

0 0
原创粉丝点击