set headless ubuntu linux display resolution
957
Perhaps try creating an /etc/X11/xorg.conf file with something like:
Section "Device"
Identifier "VNC Device"
Driver "vesa"
EndSection
Section "Screen"
Identifier "VNC Screen"
Device "VNC Device"
Monitor "VNC Monitor"
SubSection "Display"
Modes "1280x1024"
EndSubSection
EndSection
Section "Monitor"
Identifier "VNC Monitor"
HorizSync 30-70
VertRefresh 50-75
EndSection
... where 1280x1024 would be replaced by the resolution you want.
I did not test it myself; this is from http://ubuntuforums.org/showthread.php?p=8636175 (first post).
Related videos on Youtube
Author by
Porcupious
Updated on September 18, 2022Comments
-
Porcupious over 1 year
I am trying to convert ip addresses to hostnames. I tried the answer given here. While the linux command "host" works for all the ip addresess I have, this code only works for some of them. Why would this be?
InetAddress addr = InetAddress.getByName("192.168.190.62"); String host = addr.getHostName(); System.out.println(host);
-
Tom Fishman over 12 yearsThe monitor's name is showing as "Laptop" for some reason.
-
Raptor over 9 yearsWhere is your code ?
-
Porcupious over 9 yearsI've just added in the code I'm using. I basically took it from the other answer on stackoverflow.
-
Raptor over 9 yearsThe code works or not depend on your DNS.
-
Porcupious over 9 yearsI'm on a corporate network. Is there a way/need for me to force the DNS server or such? I'm surprised that the command "host" and this work differently, I would have expected them to be identical.
-
Raptor over 9 yearsI just noticed you use private IP. Do you want to resolve computer host name instead (then this is not related to DNS, sorry for confusion). See this
-
Porcupious over 9 yearsI'm actually not sure which one I want. However, it seems to me like the computer hostname works, but DNS resolves do not. Maybe host is smart enough to do reverse DNS but InetAddress is not? (for intranet dns server maybe)
-
-
Tom Fishman over 12 yearsIt doesn't work for me. My ubuntu is using remote desktop sharing for me to vnc. So the resolution is pre-determined at booting time. xorg.conf doesn't seem to affect the resolution so far.
-
Tom Fishman over 12 yearsIt doesn't work for me. My ubuntu is using remote desktop sharing for me to vnc. So the resolution is pre-determined at booting time. this "geometry" option doesn't affect the result.
-
sciurus over 12 years"My ubuntu is using remote desktop sharing for me to vnc." Can you try to explain this in more detail? How is TightVNC started?
-
Porcupious over 9 yearsI tried using that, and I got the same result. Atleast, there are ip addresses that neither getHostName() or getCanonicalHostName() are unable to return a valid value, but "host" does.
-
Martin Frank over 9 yearsas mentioned in the doc, it says the result will be returned based in the system configuration name lookup service maybe you can edit this configuration (hosts.txt)?