Iteken
Posts: 2
Joined: Tue May 29, 2012 1:03 pm

Going in Blind: A headless story

Tue May 29, 2012 3:03 pm

My Pi arrived today, so I've brought it into the lab here at work (i'm a network engineer type) and ran into an immediate snag. While the SDcard borrowed from my camera should be compatible, I've no way of getting a screen onto it as I've only a Laptop at home, no TV, and of course all displays here are DVI not HDMI.

Rather than waiting for a connector to arrive via the post, I ploughed on regardless figuring it would all be fine.

Stage1 - Prep the SDcard:
I used the instructions here and win32diskimager'd the default debian install.
Before trying to boot, renamed the file boot_enable_ssh.rc --> boot.rc on the FAT partition (readable by windows).

Stage2 - Let there be Lights
Attached Ethernet onto a DHCP enabled network segment, inserted my SDcard then applied Power via a blackberry MicroUSB Adapter (exactly 5v).
after about 30 seconds, checked the DHCP server for active leases, and lo and behold, there was one. This is exciting.

Stage3 - Is there anyone in there?
tl;dr: yep: http://onebit.us/x/i/7929204051223840889.png
Nmap that IP address: ports 22 and 111 alive (111 wat?)
ssh in as pi - easy as
run startx (for testing!)

Stage4 - let there be X
add a new user
use sudo dpkg-reconfigure x11-common to change the default X permission to anybody
download & run Xming if you are windows
ssh in as the new normal user enabling X11 tunneling
run xclock to prove it's working
declare victory, be home in time for tea and medals.

instant headless X/sshd server.

All in all, day1 of pi is a resounding success. Now i'm off to toys'R'us to buy some Lego to house it.

User avatar
jbeale
Posts: 3621
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Going in Blind: A headless story

Tue May 29, 2012 3:28 pm

Thanks for posting- glad to hear of your success story!

User avatar
eastpole
Posts: 21
Joined: Wed Feb 15, 2012 7:17 pm
Location: Toronto, Canada
Contact: Website

Re: Going in Blind: A headless story

Fri Jun 01, 2012 2:41 am

Iteken wrote: Before trying to boot, renamed the file boot_enable_ssh.rc --> boot.rc on the FAT partition (readable by windows).
Iteken, you are the bomb. I had a similar problem and googled "Headless Raspberry Pi" -- your solution has made my evening much more productive. Thanks.

eastpole

PS: Bomb!

eggster
Posts: 15
Joined: Thu May 31, 2012 4:35 am

Re: Going in Blind: A headless story

Fri Jun 01, 2012 4:47 am

thanks for the information, I was wondering how this would be accomplished. I have HDMI Monitor, but it is shared with my primary desktop. Headless would be a lot easier.

skimstone
Posts: 1
Joined: Fri Jun 01, 2012 7:49 pm

Re: Going in Blind: A headless story

Fri Jun 01, 2012 7:56 pm

Thanks, this post got me on the right track for headless access. I couldn't find the boot files mentioned but I tried accessing my pi with ssh via putty using the ip address registered on my router and it worked straight away. I downloaded my debian distribution downloaded from Element14. Having plugged in the unit via HDMI I can see that sshd is started during boot.

padraigmac
Posts: 1
Joined: Sat Jun 02, 2012 11:54 pm

Re: Going in Blind: A headless story

Sun Jun 03, 2012 12:25 am

have got clock to open but still startx is coming up with errors:

primary device is not PCI - operation not permitted

SELinux: disabled on system - not enabling in X server - operation not permitted

I have installed synaptic and that opens up ok.

Am I missing something?

User avatar
rhubarb
Posts: 2
Joined: Thu Jun 14, 2012 11:54 pm
Location: atlantic europe

Re: Going in Blind: A headless story

Fri Jun 15, 2012 12:08 am

Hi Iteken,

I lost you at Stage 3:
tl;dr: yep: http://onebit.us/x/i/7929204051223840889.png
Nmap that IP address: ports 22 and 111 alive (111 wat?)
ssh in as pi - easy as
What's that in the first line? I'll try an nmap next time, and in line 3 - is that a password?

I've had marginally more headless luck with Arch than Debian, that's to say a ping and a dhcp lease, but still no connection.

Lastly, at what point do you ssh in, and is it necessary to blindly enter a user name and password on a pi-attached kbd?

Onward and upward,

Rhubarb

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4258
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: Going in Blind: A headless story

Fri Jun 15, 2012 6:42 am

You do not need to run X on the pi to use X in a headless configuration. The clients that you run on the pi are only talking to the X server you are running on your PC; the X server on the pi does absolutely nothing.

nmap is an open-source network penetration tester. It's basic job is to probe every opening your network may have and issue a detailed report on all possible methods on ingress. It is highly useful for testing what network ports a PC has open. However it is so powerful that running it on a network that you do not own is generally considered hostile. In some circumstances, such as IT management run by Vogons, you could get into trouble for just having a copy of it. Don't try it out at work or at school.

Trinity uses it in Matrix 2.

User avatar
rhubarb
Posts: 2
Joined: Thu Jun 14, 2012 11:54 pm
Location: atlantic europe

Re: Going in Blind: A headless story

Fri Jun 15, 2012 8:27 am

thanks rurwin,

the stumbling block seems to be with ssh:
- using Arch, with Rpi wired to router it gets a dhcp lease and I can ping Rpi
- I ssh [email protected] in my case, and when asked enter "root" w/o quotes as root password, as advised and get chucked off after 3 goes.

I guess I'll have to get an hdmi cable for the set-up at least, but most folks are SCART and Freeview round here.

But if anyone has an idea for the bit bold'ed above, that'd be grand.

roobarb

User avatar
rurwin
Forum Moderator
Forum Moderator
Posts: 4258
Joined: Mon Jan 09, 2012 3:16 pm
Contact: Website

Re: Going in Blind: A headless story

Fri Jun 15, 2012 9:24 am

I don't know if root has a password in Arch, it certainly doesn't in Debian. Does Arch have a regular user account? Does that work?

It is usually discouraged to log in remotely as root; leaving that open is asking for trouble. Therefore you may find that ssh explicitely refuses it.

Return to “Beginners”