Hyper-V虚拟机安装Linux后修改Linux的屏幕分辨率

  • Post author:
  • Post category:linux


Hyper-V中安装好Ubuntu后,虚拟机显示无法全屏,即使最大化窗口,也只能显示固定大小。

参考:

https://blogs.msdn.microsoft.com/virtual_pc_guy/2014/09/19/changing-ubuntu-screen-resolution-in-a-hyper-v-vm/

按照如下步骤:

1. Open Terminal
2. Type: sudo vi /etc/default/grub
3. Find the line starting with GRUB_CMDLINE_LINUX_DEFAULT, and add video=hyperv_fb:[the resolution you want].  
   The resolution I want is 1280x720.  So my line ends up looking like this: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:1280x720"
   Write the changes and quit vi.
4. Run: sudo update-grub
5. Reboot the virtual machine

重启虚拟机,就可以全屏显示了。