Surely it could be done. I have not looked into it deeply, so I can't point to existing products.
BUT here are the challenges.
You need minimum 300W for a small desktop, and perhaps 600W for a mid-range machine. Assume 75% efficiency, so you are looking for 400W to 800W power consumption at max. Now, machines run lower than their PSU's max, so derate that and suppose the average long-term consumption is still only 300 to 600W. From a 12 VDC battery that requires 25 to 50 Amps continuous draw. That is comparable to having your car parked and turned off, but with the headlights left on High-Beams. Ever done that by mistake? How long before your car battery was dead and it would not start? And how long did it take the garage to re-charge your dead battery for you? Oh, how were you planning to recharge your battery system?
Actually, one common type of unit that does this are the Uninterpretable Power Supply (UPS) systems that keep themselves charged in preparation for emergencies, and supply power when needed to keep your computer running. They are more complicated than OP asks because they take the time to invert their battery's power back to 120 VAC so you can just plug in, but they do much of what OP asks. A quick look shows units for $130 that can supply 630W for 2 minutes, or maybe only 350W for 10 minutes. For $1100 you can get one that lasts 18 minutes at 800W output and MIGHT get you an hour for a small computer. I know, UPS's are much more complex and hence more expensive than OP asked, but you get the idea - this is neither simple nor cheap to do.
As for solar power, I guarantee that, if you go to a store that specializes in solar cell power systems for off-grid locations and ask for a 500W system you will NOT like the price! Oh, and I hope you have a spare handy roof to mount it on, because it's gonna be a big unit!