Ubuntu设置屏幕分辨率

   在虚拟机装好Ubuntu,进入系统分辨率是800*600,打开显示界面设置下分辨率,设置完怎么也选不上应用,于是只能通过命令设置来解决问题。
   使用xrandr可以查看系统当前支持哪些分辨率,以及当前设置的分辨率。下面显示的是我调整后的。
soft@soft-virtual-machine:~$ xrandr
Screen 0: minimum 1 x 1, current 1440 x 900, maximum 8192 x 8192
Virtual1 connected primary 1440x900+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   800x600       60.00 +  60.32  
   2560x1600     59.99  
   1920x1440     60.00  
   1856x1392     60.00  
   1792x1344     60.00  
   1920x1200     59.88  
   1600x1200     60.00  
   1680x1050     59.95  
   1400x1050     59.98  
   1280x1024     60.02  
   1440x900      59.89* 
   1280x960      60.00  
   1360x768      60.02  
   1280x800      59.81  
   1152x864      75.00  
   1280x768      59.87  
   1024x768      60.00  
   640x480       59.94  
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自己定义一个。
soft@soft-virtual-machine:~$ cvt --help

usage: cvt [-v|--verbose] [-r|--reduced] X Y [refresh]

 -v|--verbose : Warn about CVT standard adherance.
 -r|--reduced : Create a mode with reduced blanking (default: normal blanking).
            X : Desired horizontal resolution (multiple of 8, required).
            Y : Desired vertical resolution (required).
      refresh : Desired refresh rate (default: 60.0Hz).

Calculates VESA CVT (Coordinated Video Timing) modelines for use with X.
   设置一个分辨率为1280*1024,刷新频率为60Hz的分辨率设置:
soft@soft-virtual-machine:~$ cvt 1280 1024 60
# 1280x1024 59.89 Hz (CVT 1.31M4) hsync: 63.67 kHz; pclk: 109.00 MHz
Modeline "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync
   Modeline "1280x1024_60.00"后面就是该分辨率相关的信息。通过xrandr --newmode把他加入到分辨率列表中。
   使用xrandr 创建新的mode,--newmode后面跟刚刚cvt产生的modeline信息。 
root@soft-virtual-machine:/home/soft# xrandr --newmode "1280x1024_60.00"  109.00  1280 1368 1496 1712  1024 1027 1034 1063 -hsync +vsync
root@soft-virtual-machine:/home/soft# xrandr
Screen 0: minimum 1 x 1, current 1440 x 900, maximum 8192 x 8192
Virtual1 connected primary 1440x900+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   800x600       60.00 +  60.32  
   2560x1600     59.99  
   1920x1440     60.00  
   1856x1392     60.00  
   1792x1344     60.00  
   1920x1200     59.88  
   1600x1200     60.00  
   1680x1050     59.95  
   1400x1050     59.98  
   1280x1024     60.02  
   1440x900      59.89* 
   1280x960      60.00  
   1360x768      60.02  
   1280x800      59.81  
   1152x864      75.00  
   1280x768      59.87  
   1024x768      60.00  
   640x480       59.94  
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)
  1280x1024_60.00 (0x246) 109.000MHz -HSync +VSync
        h: width  1280 start 1368 end 1496 total 1712 skew    0 clock  63.67KHz
        v: height 1024 start 1027 end 1034 total 1063           clock  59.89Hz
   添加新的mode,--addmode后面第一个参数是xrandr显示出来的列表中,你要更改目标输出的设备名称,在我这里是Virtual0.如果是直接接显示器的,可能是VGA或者其他什么的。
root@soft-virtual-machine:/home/soft# xrandr --addmode Virtual0 "1280x1024_60.00"
   添加完之后,需要做的就是将分辨率应用到指定的输出设备。
root@soft-virtual-machine:/home/soft#  xrandr --output Virtual0 --mode "1280x1024_60.00" 
   也可通过xrandr -s 来实现。
root@soft-virtual-machine:/home/soft# xrandr -s 1280x1024_60.02
   持久地记忆这个新添加的分辨率 在~/.xprofile中加入下面语句 xrandr --output VBOX0 --mode 1280x1024_60.02
  • 1
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值