I have a problem with a Sony Vaio all in one desktop model number PCG-252L. Whenever I boot it up it briefly flashes the Sony logo for a second then quickly turns to black as if I turned the monitor off. The strange thing is that when I actually press the button to turn off the monitor then turn it back on it will post an image for a few seconds before going straight to black. Before this happened I was running Ubuntu and had no viruses to the best of my knowledge. What can I do to fix this?

Have you tried booting from a CD? If that works, there will be a problem with your hard drive, what will be pretty easy to fix.
If not, you'll probably have to take your laptop back to the store, as that means your BIOS is not functioning correctly (at all).

Well the OS itself boots fine. The problem seems to be that the hardware thinks that I constantly have the monitor off switch pressed even when I don't and it does from the moment the Vaio logo appears on start-up so the boot CD thing didn't do much. Sounds like I'm just gonna have to send it to a PC repair shop.

Well the OS itself boots fine. The problem seems to be that the hardware thinks that I constantly have the monitor off switch pressed even when I don't and it does from the moment the Vaio logo appears on start-up so the boot CD thing didn't do much. Sounds like I'm just gonna have to send it to a PC repair shop.

Didn't notice you said it was a desktop model :)
I guess just return it to the store as you say, will be fixed in no time probably :)