Login window resolution

Ray Parrish crp at cmc.net
Sun Mar 22 20:19:04 UTC 2009


Chris G wrote:
> On Sun, Mar 22, 2009 at 11:57:45AM -0700, Ray Parrish wrote:
>   
>> Mahadi Hasan wrote:
>>     
>>> My login window resolution is bigger than that of my desktop. My 
>>> desktop's resolution is 1024*768. How do I bring the login window 
>>> resolution to 1024*768?
>>>
>>> Regards,
>>> Mahadi
>>>       
>> Hello,
>>
>> There are a couple of ways that you can try, have a look at the 
>> following which contains a few ways of doing what you want. I originally 
>> posted it in another group, in an attempt to help a Windows user get 
>> Ubuntu installed on his machine, which kept coming up in too high of a 
>> resolution to be able to read the screen at boot up time.
>>
>> Since I was writing to a green Windows user in that post, I included  
>> lot of instructions on the use of sude, etc which you might already know 
>> how to do, so skim over those parts if you already know them, and read 
>> the parts about changing the boot up resolution which you are interested in.
>>
>> For this firsat method, go to System, Administration, Start Up Manager 
>> on the Ubuntu menu, and then to the
>>  > Boot Options tab of the resulting dialog. This tab allows me to choose
>>  > from resolutions anywhere from 600 x 480 to 1600 x 1200 and also
>>  > selections of 8 bit to 24 bit for color depth for the login screen.
>>  >
>>  > Be prepared for a long wait while this program goes through it's
>>  > pre-configuration tasks, and post-configuration tasks when you start it
>>  > and exit it. I changed one option [resolution from 640x480 to 800x600]
>>  > and it kept running it's little progress bar animation back and forth
>>  > for the past ten minutes, so I got bored and closed it from the title
>>  > bar button.
>>  >
>>  > OK, it took me a bit of spelunking to discover this, but grub [the boot
>>  > up manager] has an optional, not always there, configuration file at
>>  > /etc/default/grub which can specify the vga mode for the boot up screen
>>  > among other things. This can be set by the use of Start Up Manager, or
>>  > alternatively created with a text editor. I had to examine the grub
>>  > scripts to find this out. By examining the
>>  > /usr/share/pyshare/bootconfig/grub.py script file which determines the
>>  > resolution on start up I found the following information.
>>  >
>>  > """Return the Grub vga code used, as an integer.
>>  >
>>  > If no code is specified in the config, 769 is returned. [which is 640 
>> x 480, 8 bits color]
>>  > Grub vga codes:
>>  >
>>  > Colors 640x400 640x480 800x600 1024x768 1152x864 1280x1024 1600x1200
>>  > --------+----------------------------------------------------------
>>  > 4 bits |  ?             ?             770          ?         
>> ?               ?                 ?
>>  > 8 bits | 768         769         771          773           
>> 353           775            796
>>  > 15 bits | ?           784         787          790           
>> 354           793             797
>>  > 16 bits | ?           758         788          791           
>> 355           794             798
>>  > 24 bits | ?           786         789          792           
>> ?               795             799
>>  > 32 bits | ?           ?              ?              ?              
>> 356            ?                 ?
>>  >
>>  > There is a setting in the /boot/grub/menu.lst file which specifies this
>>  > value, and evidently the previously mentioned /etc/default/grub is not
>>  > used, as I thought, even 'though the grub.py script looks for that
>>  > configuration file. So, according to menu.lst the following applies. -
>>  >
>>  > ## lines between the AUTOMAGIC KERNELS LIST markers will be modified
>>  > ## by the debian update-grub script except for the default options below
>>  >
>>  > ## DO NOT UNCOMMENT THEM, Just edit them to your needs
>>  >
>>  > ## ## Start Default Options ##
>>  >
>>  > And a ways further down from that is this section. Here you can set 
>> the video resolution for the default kernel to be booted.
>>
>> [Note that for 1024 x 768, 24 bits color mode, you should use vga=792 on 
>> the defoptions line below.]
>>  >
>>  > ## additional options to use with the default boot option, but not with the
>>  > ## alternatives
>>  > ## e.g. defoptions=vga=791 resume=/dev/hda5
>>  > # defoptions=quiet splash vga=792
>>  >
>>  > Here we see the vga mode being set for the default boot option, and one
>>  > # sign marks it as being in use, instead of being a comment like the
>>  > lines with two ##'s in the AUTOMAGIC section of the menu.lst file.
>>  >
>>  > So... to change the default resolution used on your system during start
>>  > up,change the vga=nnn to the number representing the resolution you want in
>>  > boot/grub/menu.lst, from the table previously pasted in above, and also
>>  > make sure that no /etc/default/grub file exists that could modify the
>>  > value to one you do not want.
>>  >
>>  > I also note that it states in the grub.py file that if no code is
>>  > specified in the config it will default to the value vga=769 which
>>  > corresponds to 640x480, 8 bit colors. Further, to apply that resolution to
>>  > all kernels installed and specified in the menu.lst file, instead of
>>  > just the default kernel, you would need to change the following section
>>  > of the AUTOMAGIC section to include the vga=792 setting as shown below,
>>  > and you would leave out the change to the defoptions section above,
>>  > which only applies to the default kernel in use.
>>  >
>>  > ## default kernel options for automagic boot options
>>  > ## If you want special options for specific kernels use kopt_x_y_z
>>  > ## where x.y.z is kernel version. Minor versions can be omitted.
>>  > ## e.g. kopt=root=/dev/hda1 ro
>>  > ## kopt_2_6_8=root=/dev/hdc1 ro
>>  > ## kopt_2_6_8_2_686=root=/dev/hdc2 ro
>>  > # kopt=root=UUID=d87df8a8-9b0a-46c9-82ef-7c5503f46c62 ro vga=792
>>
>> [once again, for a resolution at boot up of 1024 x 768 in 24 bit color 
>> mode, use vga=792 on the configuration line above.]
>>
>> There you go, three ways to set the resolution of your start up screen. 8-)
>>
>>     
> .... but isn't that "start up screen" as opposed to the gdm login screen?
>   
I'm not aware that there is a difference between them. My system logs in 
automatically for me, so I never notice any differences in the various 
screens as my machine boots up. Hold on, I'll double check the script 
file to examine it's exact wording again. It just says

"--Set the resolution based on grub vga code."  As you can see in this 
copy from the script itself, and this is the function responsible for 
actually setting the video resolution...

[begin function]

    def set_vga_code(self, vga):
        """Set the resolution based on Grub vga code.

        vga = grub vga code
        For vga codes, see get_vga_code

        """
        options = self.__get_linux_options()
        for i, option in enumerate(options):
            if option[:4] == 'vga=':
                del options[i]
        options.append('vga=' + str(vga))
        self.__set_linux_options(options)

[end functiion]

I've copied a couple of other functions from that script file, and I'm 
pasting them in here also, they change the gfxmode screen resolution 
[whatever that is] according to the comments in their scripts.

[start quote]

    def get_gfxmode(self):
        """Return the gfxmode resolution used in Grub menu.

        Return -1 if no gfxmode can be and reading boune.
        """
        return utils.get_and_trim_line(self.header_config_file, 'set 
gfxmode=')

    def set_gfxmode(self, resolution):
        """Set the gfxmode resolution for Grub menu.

        resolution ex. '1024x768'
        Return 1 if the value can not be set.

        """
        filename = self.header_config_file
        identifier = 'set gfxmode='
        line_number = utils.get_line_number(filename, identifier)
        if line_number == -1:
            # We do not know where to insert the value
            return 1
        self.__change_config(filename, identifier, resolution)

[end quote]

None of these function definitions are very specific in their comments, 
about just exactly *where* they're setting the resolution. The only 
thing I can suggest is to try them, and then let us know the results, of 
making the changes in the different places.

Later, Ray Parrish

-- 
Human reviewed index of links about the computer
http://www.rayslinks.com
Poetry from the mind of a Schizophrenic
http://www.writingsoftheschizophrenic.com/





More information about the ubuntu-users mailing list