Ubuntu Server 18.04 EDA服务器安装日志

Ubuntu Server 18.04 EDA服务器安装日志

2018年09月01日 19:59:52 丸子炖白菜 阅读数:360

目录

目标

步骤

1. 制作安装盘

2. 安装ubuntu

3. 安装桌面

4. 配置VNC

5. 安装Quartus II 18.0

6. 安装Synopsys, Mentor

7. Samba共享

8. 修改分辨率

9. 安装多版本GCC

10. 修改网卡名字

总结


目标

  • 在局域网内配置一台EDA工作站,供多人使用。
  • 系统选择Ubuntu Server 18.04 LTS。
  • 配置Xfce4桌面环境与多用户VNC登录。
  • 安装Quartus II 18.0, Verdi, VCS, Modelsim等EDA工具。

步骤

1. 制作安装盘

官网下载:ubuntu-18.04.1-live-server-amd64.iso

使用UltraISO打开安装镜像文件,启动->写入硬盘镜像, 选择U盘,写入。

安装盘制作完毕。

2. 安装ubuntu

BIOS选择USB启动。

按照提示一路前进,Optional的软件全部忽略。

分区策略:

 
  1.     SSD 256G

  2.         /boot/efi    500M

  3.         /boot/       500M

  4.         /swap       32G

  5.         /            剩下所有

  6.     HDD 500G

  7.         /home       500G  

速度很快,几分钟就装好了。

3. 安装桌面

重启后,开始安装必备软件包和桌面环境。

Server版默认仓库不全,很多包都找不到,所以全加上:

 
  1. sudo add-apt-repository main && \

  2. sudo add-apt-repository universe && \

  3. sudo add-apt-repository restricted && \

  4. sudo add-apt-repository multiverse && \

  5. sudo apt-get update

安装XFCE4和一些必备的软件:(后面几个x开头的的包是解决第二个vnc打开灰屏的问题,和远程vnc与本机startx不能同时运行的问题,反正不装上vnc是没法正常用的)

 
  1. sudo apt-get install \

  2. gcc \

  3. g++ \

  4. gdb \

  5. openssh-server \

  6. vim-gtk3 \

  7. net-tools \

  8. xfce4 \

  9. xfce4-terminal \

  10. xfce4-goodies \

  11. tigervnc-standalone-server \

  12. firefox \

  13. gnome-system-monitor \

  14. xvfb \

  15. xfonts-100dpi \

  16. xfonts-75dpi \

  17. xfonts-cyrillic \

  18. xorg \

  19. dbus-x11 \

  20. -y

卸载屏保程序:(VNC用户长时间没有操作,屏保自动打开,不停变化的图案大量占用网络带宽)

sudo apt-get remove xscreensaver

解决配置网卡等待2分钟:“A start job is running for wait for Network to be Configured()_”(这个是因为有一个40G的网卡没有插在交换机上导致的)

 
  1. systemctl disable systemd-networkd-wait-online.service

  2. systemctl mask systemd-networkd-wait-online.service

安装中文支持语言包和中文字体:

 
  1. sudo apt-get install language-pack-zh-hant language-pack-zh-hans -y && \

  2. sudo apt-get install fonts-droid-fallback ttf-wqy-zenhei \

  3. ttf-wqy-microhei fonts-arphic-ukai fonts-arphic-uming -y &&\

  4. sudo apt-get install ttf-mscorefonts-installer -y

  5. sudo fc-cache -f -v

装完中文语言包默认会变成中文,在下面几个文件添加环境变量

 
  1. sudo gvim /etc/environment

  2. 增加

  3. LANG="en_US.UTF-8"

  4. LANGUAGE="en_US:en"

 
  1. sudo vim /var/lib/locales/supported.d/local

  2. 修改

  3. en_US.UTF-8 UTF-8

 
  1. sudo vim /etc/default/locale

  2. 修改

  3. LANG=”en_US.UTF-8″

  4. LANGUAGE=”en_US:en” 

使配置生效

sudo locale-gen

调整时间:设置时区

 
  1. timedatectl set-timezone "Asia/Shanghai"

  2. timedatectl status

网上同步时间并将系统时间写入硬件时间

 
  1. sudo apt-get install ntpdate

  2. ntpdate cn.pool.ntp.org

  3. hwclock --systohc

4. 配置VNC

vncserver的选择, 这个至关重要!!!

开始用的是 vnc4server,也试了tightvnc。登录之后发现Quartus卡死,而本机完全没问题。后来发现Quartus18.0的界面用了新版本的QT,和vnc不兼容,主机正常,vnc中无法打开GUI,直接卡死。而且有些能打开的软件,键盘输入是乱的。VS Code也打不开。

报错信息:

Failed to initialize XRandr VNC
XKEYBOARD extension not present on the X server VNC
xkb extension not present on

尝试了各种办法都没有效果,xrdp登录也不行,最后发现了 tigervnc才解决了这个问题。只有tigervnc才支持XRandr,还能能够动态的调节分辨率。tigervnc是github上的项目,一直在更新,有人解答问题, 比较靠谱。

PS: Tiger的vncviewer效率比较高,流畅度明显比之前用的realvncviewer要好,就是登陆界面做的太丑了。

VNC Server启动命令:

tigervncserver :1  -geometry 2560x1388 -depth 24 -localhost no

Ubuntu18.04仓库里默认的是1.7版本,需要加localhost这个参数,不然vncviewer无法连接,这个也是坑爹坑到家了,如果能早点把tigervnc用起来,这个Qt GUI的问题也不会搞很久。最新的1.9版本不需要加了,这个参数被作废了。

开机自启动脚本(三个文件)

/etc/vncserver/vncservers.conf

 
  1. VNCSERVERS="1:1920x1080:user0"

  2. VNCSERVERS=${VNCSERVERS}" 2:1920x1080:user1"

  3. VNCSERVERS=${VNCSERVERS}" 5:1920x1080:user2"

  4. VNCSERVERS=${VNCSERVERS}" 6:2560x1388:user3"

/etc/init.d/vncserver.sh

 
  1. VNCSERVERS=""

  2.  
  3. [ -f /etc/vncserver/vncservers.conf ] && . /etc/vncserver/vncservers.conf

  4. # [ -f vncservers.conf ] && . vncservers.conf

  5. echo $VNCSERVERS

  6.  
  7. prog=$"VNC server"

  8. . /lib/lsb/init-functions

  9.  REQ_USER=$2

  10.  echo -n $"Starting $prog: "

  11.  ulimit -S -c 0 >/dev/null 2>&1

  12.  RETVAL=0

  13. for display in ${VNCSERVERS}

  14. do

  15.     export USER="${display##*:}"

  16.     if test -z "${REQ_USER}" -o "${REQ_USER}" == ${USER} ; then

  17.         echo -n "${display} "

  18.         unset BASH_ENV ENV

  19.         DISP="${display%%:*}"

  20.         GEOMETRY=`echo $display | sed 's/.*:\(.*\):.*/\1/g'`

  21. #        echo $DISP

  22. #        echo $USER

  23. #        echo $GEOMETRY

  24.         su ${USER} -c "cd ~${USER} && [ -f .vnc/passwd ] && vncserver -geometry ${GEOMETRY} :${DISP} && exit"

  25.     fi

  26. done

/etc/rc.local

 
  1. #!/bin/sh -e

  2. #

  3. # rc.local

  4. #

  5. # This script is executed at the end of each multiuser runlevel.

  6. # Make sure that the script will "exit 0" on success or any other

  7. # value on error.

  8. #

  9. # In order to enable or disable this script just change the execution

  10. # bits.

  11. #

  12. # By default this script does nothing.

  13.  
  14. bash /etc/init.d/vncserver.sh

  15.  
  16. exit 0

5. 安装Quartus II 18.0

最难搞的问题是启动时GUI卡死,在前面关于VNC的问题里已经说明。

缺库Solution:

 
  1. wget http://ftp.cn.debian.org/debian/pool/main/libp/libpng/libpng12-0_1.2.49-1+deb7u2_amd64.deb

  2. sudo apt install ./libpng12-0_1.2.49-1+deb7u2_amd64.deb

库版本报错Solution:

 
  1. mv /tools/intelFPGA/18.0u_pro/quartus/linux64/liblzma.so.5 /tools/intelFPGA/18.0u_pro/quartus/linux64/liblzma.so.5.bak

  2. ln -s /lib/x86_64-linux-gnu/liblzma.so.5.2.2 /tools/intelFPGA/18.0u_pro/quartus/linux64/liblzma.so.5

报错

libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast

这个使用 LIBGL_DEBUG=verbose quartus 就可以看到详细错误信息,根据提示,得到Solution:

 
  1. mv /tools/intelFPGA/18.0u_pro/quartus/linux64/libstdc++.so.6 /tools/intelFPGA/18.0u_pro/quartus/linux64/libstdc++.so.6.bak

  2. ln -s /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25 /tools/intelFPGA/18.0u_pro/quartus/linux64/libstdc++.so.6

6. 安装Synopsys, Mentor

Crack就不说了,eetop去搜吧。

lmgrd无法执行,报错找不到,没有此文件。这个问题也是坑的让你怀疑人生,文件明明在哪里就是说没有,原来是系统不认,装个包就好了。

sudo apt-get install lsb lsb-base lsb-core

VCS

报错/bin/sh illegal option -h

Solution:

 
  1. sudo rm -f /bin/sh

  2. sudo ln -s /bin/bash /bin/sh

Verdi

 
  1. mv /tools/synopsys/Verdi_vN-2017.12-SP1/etc/lib/libstdc++/linux64/libtinfo.so.5 /tools/synopsys/Verdi_vN-2017.12-SP1/etc/lib/libstdc++/linux64/libtinfo.so.5.bak

  2. ln -s /lib/x86_64-linux-gnu/libtinfo.so.5 /tools/synopsys/Verdi_vN-2017.12-SP1/etc/lib/libstdc++/linux64/libtinfo.so.5

Modelsim

sudo apt-get install libxft2

7. Samba共享

使用hostname生效:

 
  1. sudo apt-get install libnss-winbind samba -y

  2. sudo gvim /etc/nsswitch.conf

  3.     找到 hosts:          files dns

  4.     改为 hosts:          files dns wins

  5. sudo service winbind start

现在可以使用hostname来登录vnc了。

与Window共享文件夹:
前面已经安装samba的包,直接

sudo gvim /etc/samba/smb.conf

在最后加上:

 
  1. [share]

  2. comment = Share Folder require password

  3. browseable = yes

  4. path = /home/share

  5. create mask = 0777

  6. directory mask = 0777

  7. valid users = user0 user1 user2 @group_name

  8. public = yes

  9. writable = yes

  10. available = yes 

设置共享目录

 
  1. mkdir /home/share

  2. sudo chmod 777 /home/share

  3. sudo chown root:root /home/share/

添加samba用户

 
  1. sudo smbpasswd -a user0

  2. sudo smbpasswd -a user1

  3. sudo smbpasswd -a user2

重启samba服务

 
  1. sudo service smbd restart

  2. sudo service nmbd restart

此时window上可以看到server的共享目录并用对应的用户登录访问。

PS: Samba相对scp拷贝文件还是快不少的。千兆网Winscp拷贝只有半速,Babun里scp大概用到80%带宽,Samba是全速。

挂载windows上的共享:

 
  1. sudo apt-get install cifs-utils

  2. sudo  mount -t cifs //192.168.xxx.xxx/dd$ ~/mnt -o username=your_name,gid=1000,uid=1000

8. 修改分辨率

查看分辨率和输出设备

xrandr

    Screen 0: minimum 32 x 32, current 1920 x 1148, maximum 32768 x 32768
    VNC-0 connected 1920x1148+0+0 0mm x 0mm
    1920x1148     60.00*+
    1920x1200     60.00  
    1920x1080     60.00  
    1600x1200     60.00  
    1680x1050     60.00  
    1400x1050     60.00  
    1360x768      60.00  
    1280x1024     60.00  
    1280x960      60.00  
    1280x800      60.00  
    1280x720      60.00  
    1024x768      60.00  
    800x600       60.00  
    640x480       60.00  
列表里面没有,需要添加。输入要设置的分辨率,用cvt生成一个Modline

cvt 2560 1388

    # 2560x1388 59.95 Hz (CVT) hsync: 86.26 kHz; pclk: 299.50 MHz
    Modeline "2560x1388_60.00"  299.50  2560 2744 3016 3472  1388 1391 1401 1439 -hsync +vsync
把输出的Modeline粘贴到newmode后面,并添加修改

 
  1. xrandr --newmode "2560x1388_60.00"  299.50  2560 2744 3016 3472  1388 1391 1401 1439 -hsync +vsync

  2. xrandr --addmode VNC-0 "2560x1388_60.00"

  3. xrandr --output VNC-0 --mode "2560x1388_60.00"

9. 安装多版本GCC

 
  1. sudo apt-get install gcc-4.8 gcc-4.8-multilib

  2. sudo apt-get install g++-4.8 g++-4.8-multilib

  3. sudo apt-get install gcc-5 gcc-5-multilib

  4. sudo apt-get install g++-5 g++-5-multilib

  5. sudo apt-get install gcc-6 gcc-6-multilib

  6. sudo apt-get install g++-6 g++-6-multilib

  7. sudo apt-get install gcc-7 gcc-7-multilib

  8. sudo apt-get install g++-7 g++-7-multilib

  9. sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 48

  10. sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 50

  11. sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 60

  12. sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 70

  13. sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 48

  14. sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-5 50

  15. sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 60

  16. sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 70

切换版本

 
  1. sudo update-alternatives --config gcc

  2. sudo update-alternatives --config g++

目前VCS只有用gcc4.8才不报错。gcc-5是版本5.5,也不行。Ubuntu 16.04上默认gcc版本是5.4,VCS没问题。可能是VCS不支持版本大于5.4的gcc吧。

10. 修改网卡名字

网卡默认名字是ensXX,而有些EDA工具不认这个名字,导致license Check Out 失败,比如Quartus 16.0。所以必须改成eth0。

sudo gvim /etc/network/interfaces

添加文件内容:
auto  lo
iface lo inet loopback

auto eth0 
iface eth0 inet dhcp

auto eth1 
iface eth1 inet static
address 192.168.10.1
netmask 255.255.255.0

auto eth2 
iface eth2 inet static
address 192.168.10.2
netmask 255.255.255.0

sudo gvim /etc/default/grub

找到 GRUB_CMDLINE_LINUX=""

改为 GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"

更新grub配置文件 :

sudo update-grub

重启。

总结

安装过程坑太多,各种乱七八糟的问题没有做详细描述,贴的命令基本就是解决方案。

发布了47 篇原创文章 · 获赞 17 · 访问量 6万+

猜你喜欢

转载自blog.csdn.net/liuzq/article/details/89388190