# [noob] need help with pdf book



## psycho (Oct 16, 2009)

Hi Everyone!
I have really annoying problem to solve!
I have dual-boot (Win/FreeBSD 8.0).
The thing is I downloaded really awesome book from http://www.lemis.com/grog/Documentation/CFBSD in PDF format.
I have this book on Windows and problem is that I read this book on Windows OS and it doesn't mean anything because I can't do examples because I'm not in FreeBSD OS.
So my main goal is to transferr that .PDF book to FreeBSD.
Can I put it on USB while in Windows than reboot and from USB stick copy it on FreeBSD so i can read it from there.

One more thing!I don't have any DE on FreeBSD and no xorg installed. HELP!


----------



## SirDice (Oct 16, 2009)

psycho said:
			
		

> Can I put it on USB while in Windows than reboot and from USB stick copy it on FreeBSD so i can read it from there.


Yes. You can also mount your Windows partitions and read it from there.



> One more thing!I don't have any DE on FreeBSD and no xorg installed. HELP!



http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x11.html


----------



## psycho (Oct 16, 2009)

so i need to do this:
1.boot freebsd
2.connect usb stick (i hope module will recognize it!)
3.with command "cp" copy that .PDF on /usr
4.open it with command view /usr/freebsdbook.pdf

am i right?


----------



## DutchDaemon (Oct 16, 2009)

You can't 'view' pdf files with vi (which is what 'view' is). You will need to install a desktop environment / window manager and a PDF reader.

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/x11.html


----------



## dennylin93 (Oct 16, 2009)

I'm not really sure if you'll be able to view PDF files like this. Normally, you need something like xpdf or Adobe Reader.

Also, copy the file into your home directory instead of /usr.


----------



## psycho (Oct 16, 2009)

and if i download book in postscript format
would i be able to read it in terminal??


----------



## DutchDaemon (Oct 16, 2009)

Your best shot may be to open the PDF in Windows. mark the text in the PDF reader, paste it to a text file (notepad), and read that on FreeBSD.


----------



## Zare (Oct 16, 2009)

You need to;

 - install X11
 - install some WM/DE (X11 will include twm, but it's too exotic for beginners)
 - mount your USB flashdrive, or your windows partition
 - install some pdf viewer (eg. xpdf for example)
 - open the file.

Therefore, you should first read some chapters in the handbook. You'll need to read about ports/packages system for program installation, X11 configuration, disk management and mounting. Of course, you'll need working internet access first.

If you're just about to begin on FreeBSD, i suggest installing it in some virtual machine under Windows, or using PC-BSD - user-friendly system based on FreeBSD that has all beginner stuff already done for you.


----------



## psycho (Oct 16, 2009)

what WM/DE are you using Zare????
i was thinking about FVWM or KDE??
any sugestions?


----------



## vivek (Oct 16, 2009)

I've gnome installed and it works great. All I've to do is type the following at the shell prompt while terminal is opened:

```
gnome-open file.pdf
gnome-open file.mp3
gnome-open file.doc
gnome-open movie.avi
```

Another option is use pdftotext command to convert a PDF to text-file.:

```
pdftotext {PDF-file} {text-file}
```
To install pdftotext

```
cd /usr/ports/graphics/poppler-utils
make install clean && rehash
pdftotext your.pdf out.txt
vi out.txt
```

See more examples here:
http://poppler.freedesktop.org/
http://www.cyberciti.biz/faq/converter-pdf-files-to-text-format-command/


----------



## Beastie (Oct 16, 2009)

psycho said:
			
		

> i was thinking about FVWM or KDE??
> any sugestions?


Wow, you couldn't find any more dissimilar WM/DE to put in a single sentence? 
For a BSD beginner who's used to Windows, I'd recommend Xfce, or if you have the H/W required specs, GNOME or KDE.
And when you're more experienced and familiar with everything, you can remove all these and install FVWM (or keep them just for fun). :e

For PDFs, epdfview is good.

And welcome to FreeBSD.


----------



## Zare (Oct 17, 2009)

@psycho, i use WindowMaker.


----------



## psycho (Oct 18, 2009)

ok so let's say i want to install gnome!
First I have to install X11!
I tried to do that.
with:
cd /usr/ports/x11
make install clean
Then it starts and it gives me information that 3ddesktop was not found and starts connecting to web pages because it has to fetch something -.-.
It drives me crazy
First i thought i should establish my Internet connection.
I used this tutorial http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/book.html#PPPOE to connect but it didn't worked so i changed my modem from bridge to route mode so i dont have to connect manually.
And again i have the same thing. hlp hlp


----------



## DutchDaemon (Oct 18, 2009)

psycho said:
			
		

> First I have to install X11!
> I tried to do that.
> with:
> cd /usr/ports/x11
> ...



You are installing *all* of the x11 ports like that, 492 in total. You are in the wrong directory, go to /usr/ports/x11/xorg.


----------



## psycho (Oct 18, 2009)

ok, but whatever i start installing, it finds some missing file and starts connecting to some pages but it obviusly can't connect because there my installation interrupts?!?


----------



## Zare (Oct 19, 2009)

You aren't connected to the internet, or your DNS isn't working.

What kind of connection do you have, are you behind a router with DHCP, etc?


----------



## psycho (Oct 19, 2009)

i have ZyXEL Prestige 600 series, by the way i live in Bosnia and I have ADSL connected.
My modem is currently in routing mode because i thought it would be easier to connect FreeBSD to Internet(plug 'n' play )and nothing.
But modem is usually in Bridge mode!
While i was in bridge mode I used this PPPoE tut:http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/book.html#PPPOE to connect but with no succes.  

@Zare: btw ja sam bob_marley sa jezgra.org ;D


----------



## Kane (Oct 19, 2009)

hy psycho! Au Fidazen! Just tell me when you solve this problem ok! bye bye godbye astalavista!


----------



## psycho (Oct 23, 2009)

Hello everyone. I have 2 questions:
1.Is xorg installation necessary to install any other DE?
2.How to connect to internet.?
I see internet connection is my primary problem because whatever port(which i added from CD while installing FreeBSD) I try to install with changing directory to that port and typing make install clean it gives me message that there are some mising files (like 3ddesktop with xorg installing) and then starts connecting to some web pages but no succes.
So I realised I have to connect to internet. Here is overview of what was I doing so tell me where did i go wrong? :

1. Edit /etc/ppp/ppp.conf, then replaced this parts of code with my username and password:

```
papchap:
set authname MYUSERNAME
set authkey MYPASSWORD
```
While i was still in ppp.conf I checked if my device driver is set to:  set device PPPoE:/dev/cuaa1 (by default and it was)

2.Modified /etc/rc.conf
by adding this line of code:

```
ppp_enable=YES
```

3. tried to start internet connection with:
`# /usr/sbin/ppp -quiet -auto papchap`
But I see it doesn't work because i tried to installed xorg once again after doing all of this but still nothing. HELP!


----------



## kpedersen (Oct 23, 2009)

Umm... might be easier to...

1) Download the FreeBSD DVD image (I need to go into University to do this step )
2) Burn to DVD
3) Insert DVD into FreeBSD 'puter
4) Mount DVD
5) cd to packages dir on the DVD
6) pkg_add gnome2-xxxx (The meta package)

Compiling from ports is no good for a lot of people because of its dependency of a good internet connection is rarely met.
Installing from packages from the DVD is probs the best way to start out.


----------



## psycho (Oct 23, 2009)

ok i'll try that.

Btw do you have any ideas about internet connection?


----------



## Zare (Oct 23, 2009)

> 1.Is xorg installation necessary to install any other DE?



Yes, it's the main graphics environment. You install desktop environments or window managers on top of xorg. Eg, they all depend and use xorg's API.



> 2.How to connect to internet?



Switch back your router into routing mode, make sure it connected itself to the internet and that his DHCP is working. Test with some other operating system (eg Windows if you have them).

You need to configure your network adapter to use DHCP autoconfiguration. The command;


```
ifconfig -a
```

should return all network adapters, both configured and unconfigured. It looks like this. This is the output from my workstation;


```
$ ifconfig -a
em0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=19b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4>
        ether 00:1c:c0:94:b4:4e
        inet 192.168.150.10 netmask 0xffffff00 broadcast 192.168.150.255
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
fwe0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8<VLAN_MTU>
        ether 02:90:27:3f:d3:b1
        ch 1 dma -1
fwip0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        lladdr 0.90.27.0.2.3f.d3.b1.a.2.ff.fe.0.0.0.0
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=3<RXCSUM,TXCSUM>
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4 
        inet6 ::1 prefixlen 128 
        inet 127.0.0.1 netmask 0xff000000 
$
```

So i have primary network card on the top (em0), firewire interfaces (fwe0 and fwip0) and loopback device (lo0). Keep in mind that freeBSD doesn't name network adapters like Linux (eth0, eth1, eth2), it names them by their driver, where in my example the "em" driver is used for Intel PRO/1000 interfaces. If you aren't sure what driver your card uses, you can always grep through the boot messages, for instance;


```
$ dmesg | grep em0
em0: <Intel(R) PRO/1000 Network Connection 6.9.14> port 0x4400-0x441f mem 0x93200000-0x9321ffff,0x93224000-0x93224fff irq 20 at device 25.0 on pci0
em0: Using MSI interrupt
em0: [FILTER]
em0: Ethernet address: 00:1c:c0:94:b4:4e
em0: link state changed to UP
```

This basically confirmes that em0 is the Intel PRO/1000 card. If i had two of those, i'd have em0 and em1. If i had one Intel PRO/1000 and one Intel PRO/100, i'd have em0 and fxp0, because PRO/100 is controlled by "fxp" driver.

Another way to check what interface you want is to check the first line of it's ifconfig output;


```
em0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
```

You see the "UP" flag there, therefore the interface has a physical connection to other side (cable connected). 

For the sake of example, you've detected your wanted network card as "xl0". Issuing a simple command


```
dhclient xl0
```

should run the DHCP autoconfiguration of the interface. You'll see DHCP  progress on your console, dhclient should add the router as primary gateway and DNS server. Command


```
route get default
```

will show routing table where you can confirm gateway entry;


```
$ route get default
   route to: default
destination: default
       mask: default
    gateway: IP ADDRESS OR HOSTNAME OF YOUR ROUTER SHOULD BE HERE
  interface: em0
      flags: <UP,GATEWAY,DONE,STATIC>
 recvpipe  sendpipe  ssthresh  rtt,msec    mtu        weight    expire
       0         0         0         0      1500         1         0
```

You can also confirm DNS entries by doing "cat /etc/resolv.conf". There should be a line "nameserver IP" where IP could be either IP of the router or DNS server of your ISP, depending whether your router has DNS relay or just sends in your ISP's DNS servers via DHCP to your machine.

After that, you should be able to ping some internet site.

If you want to make DHCP configuration of your interface permanent, put the line;


```
ifconfig_xl0="DHCP"
```

in /etc/rc.conf.



> I see internet connection is my primary problem because whatever port(which i added from CD while installing FreeBSD) I try to install with changing directory to that port and typing make install clean it gives me message that there are some mising files (like 3ddesktop with xorg installing) and then starts connecting to some web pages but no succes.



Ports tree is just a repository of programs you can compile, install and maintain via automatic process and automatic dependency resolving. The source packages for those programs are located on the internet, so you need to have the connection or you can download files via some other computer, and transfer them via some medium to /usr/ports/distfiles.

You should first install xorg by running "make install clean" in /usr/ports/x11/xorg , it's metaport provides simple twm window manager, which should be enough to test graphics / keyboard / mouse. When building the port - don't tweak the options when prompted, just proceed. The vanilla compiling options should be enough for you.

Xorg should build itself with HAL support, that's for autodetection of hardware basically. There's one twitch here - you need to run HAL daemon yourself; put the line hald_enable="YES" into /etc/rc.conf, to autoload it on boot, and execute "/usr/local/etc/rc.d/hald start". Then execute "startx" to initiate Xorg.

When you have working internet connection and fully operational xorg, you can install and try any DE/WM from the ports tree.
Pozdrav


----------



## psycho (Oct 23, 2009)

tnx a lot, 
i will try and post if some errors ocure


----------



## Ruler2112 (Oct 23, 2009)

This may seem overly simplistic and certainly won't address the network connectivity problem, but you also won't have to install a DE environment either.  Why not just boot into windoze, load the PDF, click print, wait for the printer to get done, reboot into BSD, and read from the paper?


----------



## psycho (Oct 24, 2009)

Ruler2112:


> This may seem overly simplistic and certainly won't address the network connectivity problem, but you also won't have to install a DE environment either. Why not just boot into windoze, load the PDF, click print, wait for the printer to get done, reboot into BSD, and read from the paper?


Even if I have one, i wouldn't done that because printing cca. 800 pages isn't that helpful.


----------



## psycho (Oct 27, 2009)

new problem 
here is output of command: ifconfig -a

```
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST>metric 0 mtu 1500
options=389b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
ether 00:1a:92:34:04:9b
inet 192.168.1.55 netmask 0xffffff00 broadcast 192.168.1.255
inet6 fe 80::21a:92ff:fe34:49b%re0 prefixlen 64 scopeid 0x1
media: Ethernet autoselect (none)
status:no carrier

plip0:flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> metric 0 mtu 1500

lo0:flags=8049<UP,LOOPBACK,RUNNING,MULTICAST>metric 0 mtu 16384
       options=3<RXCSUM,TXCSUM>
       inet 127.0.0.1 netmask 0xff000000
       inet6 ::1 prefixlen 128
       inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3

tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500
      inet 10.0.0.1 --> 10.0.0.2 netmask 0xffffff00
      Opened by PID 347
```
So now I suggest that i have to choose re0 interface. I have done command: dhclient re0!(autoconfiguration of interface).
Output was like this:

```
#re0: no link ......................giving up
```
and that was it.
So i stoped at this step because something is wrong. no link, hmm??!!
and if you (dear helpers) might find this useful watch this.
My output of command: #route get default  is:

```
route to: default
destination: default
mask: default
gateway: 10.0.0.2
interface: tun0
flags: <UP,GATEWAY,DONE,STATIC>
recvpipe  sendpipe  ssthresh  rtt,msec  mtu   weight  expire
   0         0          0          0    1500    1       0
```
help


----------



## Zare (Oct 27, 2009)

```
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST>metric 0 mtu 1500
options=389b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_UCAST,WOL_MCAST,WOL_MAGIC>
ether 00:1a:92:34:04:9b
inet 192.168.1.55 netmask 0xffffff00 broadcast 192.168.1.255
inet6 fe 80::21a:92ff:fe34:49b%re0 prefixlen 64 scopeid 0x1
media: Ethernet autoselect (none)
[b]status:no carrier[/b]

plip0:flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> metric 0 mtu 1500

lo0:flags=8049<UP,LOOPBACK,RUNNING,MULTICAST>metric 0 mtu 16384
       options=3<RXCSUM,TXCSUM>
       inet 127.0.0.1 netmask 0xff000000
       inet6 ::1 prefixlen 128
       inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3

tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500
      inet 10.0.0.1 --> 10.0.0.2 netmask 0xffffff00
      Opened by PID 347
```

You don't have a physical connection to the other side. Check cables and everything. And it looks like the interface has been configured with static IP address. Edit your /etc/rc.conf, find the ifconfig_re0 line and change it to ifconfig_re0="DHCP" .


----------



## psycho (Oct 29, 2009)

yes, my modem *has* physical connection to other side but with USB cable.I also have this kind of cable:http://www.gre.ac.uk/__data/assets/image/0015/31560/rj112.jpg
So, should that solve the problem, if I use this different cable??


----------



## psycho (Oct 30, 2009)

good news!
i changed cable and now i have succesful internet connection(tnx Zare)!
I also installed Xorg.
Now when i enter "startx" it opens some DE (i don't know it's name)with 3 windows(terminals i guess)but my keybord and mouse
aren't working there??
I need to configure something??
I also installed WindowMaker with

```
cd /usr/ports/x11-wm/windowmaker
make install clean
```
But i don't know how to start it??


----------



## DutchDaemon (Oct 30, 2009)

Look in your .xinitrc. It starts twm by default (which is what you see). Replace twm with wmaker (IIRC) and see what happens.


----------



## Zare (Oct 30, 2009)

> Now when i enter "startx" it opens some DE (i don't know it's name)with 3 windows(terminals i guess)but my keybord and mouse



Edit /etc/X11/xorg.conf, inside ServerLayout section insert this;


```
Option    AllowEmptyInput "off"
```

That should do the trick. But it's not needed if your hald is functioning normally. Do you have hald_enable="YES" line in your /etc/rc.conf?


----------



## psycho (Nov 2, 2009)

ok 
where can I find this file .xinitrc ??
And Zare I dont think i have xorg.conf file, but i have
xorg.conf.new file which i get from command:
Xorg configure
????
So Xorg is 100% installed because startx works!
Is it important to have working keybord and mouse in twm 
if I am gonna install new DE (WindowMaker)


----------



## Beastie (Nov 2, 2009)

psycho said:
			
		

> where can I find this file .xinitrc ??


You don't *find* it. You *create* it in your home directory.
`% ee/vi ~/.xinitrc`, type the appropriate commands and save.




			
				psycho said:
			
		

> I dont think i have xorg.conf file, but i have xorg.conf.new


If you had read the entire handbook page related to your case, you'd know what to do. Hint: cp or mv




			
				psycho said:
			
		

> So Xorg is 100% installed because startx works!
> Is it important to have working keybord and mouse in twm if I am gonna install new DE (WindowMaker)


TWM is the bare minimum in X. So having a fully functional TWM means you're ready for the next step(s).
Add 
	
	



```
moused_enable="YES"
```
 to /etc/rc.conf and start your mouse daemon with `# /etc/rc.d/moused start` and you're most probably good to go. Don't even try HAL!

You may also need this in your /etc/xorg.conf:

```
Section "ServerFlags"
[...]
    Option "AutoAddDevices" "FALSE"
[...]
EndSection
```

And BTW, WindowMaker is a window manager, rather than a complete desktop environment like GNOME, KDE, Xfce, etc.


----------



## psycho (Nov 2, 2009)

oh man... now I'm in trouble...listen:
First I had Windows (C: partition - 39GB)
The D: disk was free.
Then I installed FreeBSD with its 
*Boot Mgr!* (took whole D: disk - 31GB) 
after that i started asking whole those questions.
And today I decided to format Windows and Install it again because i had some troubles with it.
So I booted WinXP SP2 formatted C: (*withou touching disk D: or FREEBSD!!)*
and installed WinXP on C.
After finishing when i restart computer I don't have options to choose between operating systems at all?!?!?
*It only boots Windows*
HELP...


----------



## Beastie (Nov 2, 2009)

That's normal, the Windows setup overwrote the MBR code.

You could try `# boot0cfg -B adx` from a livefs to get the menu back. I think you may also restore it in sysinstall from the install disk (disc1).


----------



## psycho (Nov 2, 2009)

oh thank god.
But is there any solution that doesn't require CD because it is currently at my friend 
And I am not that patient.
Any other soulutions ???
tnx


----------



## Zare (Nov 2, 2009)

Install some boot manager like GAG, from Windows. It can chainload both of your operating systems.


----------



## psycho (Nov 2, 2009)

zare do you have skype, msn or something?


----------



## psycho (Nov 12, 2009)

GREAT I have succesfully configured Xorg and now I have working keyboard and mouse, and using WindowMaker. it is GREAT and so FAST
tnx all for helping
i have few more questions.
1.how to change my keyboard layout, I want it to be by the croatian standards, and it really becomes annoying when i type <y> and it shows <z>
2.is there good file manager for windowmaker


----------



## psycho (Feb 3, 2010)

hello new *same* problem again !
I had to reinstall freebsd for some reasons, i installed it and done every step that zare wrote on page before so when i run "dhclient re0"
command (re0 is my interface) it gives me some discovers in intervals and fails.
Modem is in routing mode and on other OS internet is working.
HELP HELP HELP


----------

