# DHCP and package installation



## AlbertAlbertson (Jun 18, 2010)

Hello!

I'm a newbie FreeBSD user that need some help with the internet config.

I installed FreeBSD 8 on a VirtualMachine, I installed it successfully but I havent Graphic Enviroment... So, I read how to do it with pkg-add -r gnome2, but it seems i haven't the internet configured, so... I'm not sure about how configure the DHCP, because I have a router in my house (2 PCs).

I already used _Search_, but please note that english is not my mother language and I didn't understand much of what I read there :/.

So, how can I configure it?

Thanks .


----------



## wblock@ (Jun 18, 2010)

Well, there's the Handbook section on post-installation, but it's not the greatest way to do it after installation.

ifconfig will list your network adapters:
`# ifconfig`

Figure out which is the Ethernet adapter, like em0, for example.  Then log in as root and get a lease with dhclient:
`# dhclient em0`

Edit your /etc/rc.conf to make that automatic on startup:

```
ifconfig_em0="DHCP"
```

You may want to use SYNCDHCP instead.  See the rc.conf(5) man page.


----------



## AlbertAlbertson (Jun 18, 2010)

Thank you very much! The internet works (at least I can Ping Google.com) .

Anyway I tried to install the GNOME but it... simply _fails_.

I don't know why :/.


----------



## hydra (Jun 18, 2010)

How did you invoke *pkg_add* in order to install Gnome ?


----------



## AlbertAlbertson (Jun 18, 2010)

`pkg_add -r gnome2`


----------



## hydra (Jun 19, 2010)

Try to following:
`# pkg_add -rv expat`

Does it work ?


----------



## AlbertAlbertson (Jun 19, 2010)

Currently I have tried installing Xorg first.

Now I'm running:


```
# cd /usr/ports/x11/gnome2
# make install clean
```

If it doesn't works, I'll try `# pkg_add -rv expat`, thanks .


----------



## hydra (Jun 19, 2010)

Strange that it doesn't work for you, I tried to [cmd=]pkg_add -rv gnome2[/cmd] on a virtual machine (8.0-RELEASE) and it added expat and docbook without any problems. Just don't mix pkg_add and make install too much. The former is used to install packages whereas the later is used to build up ports on your own machine by compiling it. If it's possible, try to stick to one method. For example I prefer to build everything with the ports.


----------

