龙空技术网

在Ubuntu下使用VirtualBox体验EulerOS

高勇Gauss 850

前言:

此时朋友们对“ubuntu iostream”可能比较着重,咱们都想要剖析一些“ubuntu iostream”的相关知识。那么小编在网摘上汇集了一些对于“ubuntu iostream””的相关内容,希望你们能喜欢,姐妹们一起来学习一下吧!

华为的EulerOS将与鸿蒙统一内核

这里使用Ubuntu作为宿主机器,通过VirtualBox来安装EulerOS。环境如下:

宿主机:8核16G/Ubunt20.0.14/VirtualBox6.1ErlerOS:EulerOS-V2.0SP5-x86_64-dvd.iso客户机配置如下图:

客户机基本配置

>lscpuArchitecture:          x86_64CPU op-mode(s):        32-bit, 64-bitByte Order:            Little EndianCPU(s):                1On-line CPU(s) list:   0Thread(s) per core:    1Core(s) per socket:    1座:                 1NUMA 节点:         1厂商 ID:           GenuineIntelCPU 系列:          6型号:              142型号名称:        Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz步进:              10CPU MHz:             2111.900BogoMIPS:            4223.80超管理器厂商:  KVM虚拟化类型:     完全L1d 缓存:          32KL1i 缓存:          32KL2 缓存:           256KL3 缓存:           8192KNUMA 节点0 CPU:    0Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc eagerfpu pni pclmulqdq monitor ssse3 cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm 3dnowprefetch fsgsbase avx2 invpcid rdseed clflushopt md_clear flush_l1d
配置多网卡

因为需要EulerOS能够连接外网,也需要与本地局域网互通,必要时仅仅与宿主机户通。所以启用了三张网卡,来分别实现。新配置的网卡如果没有生效,可确认在宿主机启动了这些网卡,并在EulerOS中使用nmtui图形界面来管理网卡。

1、访问Internet

Virtaulbox上配置网卡为nat。

访问Internet

然后,在客户机EulerOS启用网卡,并看到如下

<:~>ifconfigenp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500        inet 10.0.2.15  netmask 255.255.255.0  broadcast 10.0.2.255        inet6 fe80::7e03:7abe:f6a6:5b43  prefixlen 64  scopeid 0x20<link>        ether 08:00:27:85:04:93  txqueuelen 1000  (Ethernet)        RX packets 53  bytes 5961 (5.8 KiB)        RX errors 0  dropped 0  overruns 0  frame 0        TX packets 61  bytes 5685 (5.5 KiB)        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

2、访问局域网

Virtaulbox上配置网卡为桥接。

客户机中启用网卡,并看到如下信息:

enp0s9: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500        inet 192.168.2.136  netmask 255.255.255.0  broadcast 192.168.2.255        inet6 fe80::7c30:6e5d:fd00:d3f2  prefixlen 64  scopeid 0x20<link>        ether 08:00:27:85:2a:f4  txqueuelen 1000  (Ethernet)        RX packets 1252  bytes 109790 (107.2 KiB)        RX errors 0  dropped 0  overruns 0  frame 0        TX packets 165  bytes 23796 (23.2 KiB)        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

3、只与宿主机通讯

Virtaulbox上配置主机网络,并将客户机网卡为Host-only。

客户机启用网卡,将看到如下信息:

enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500        inet 192.168.56.102  netmask 255.255.255.0  broadcast 192.168.56.255        inet6 fe80::6d5:1b04:f165:ec3e  prefixlen 64  scopeid 0x20<link>        ether 08:00:27:32:23:bc  txqueuelen 1000  (Ethernet)        RX packets 14  bytes 5080 (4.9 KiB)        RX errors 0  dropped 0  overruns 0  frame 0        TX packets 25  bytes 3930 (3.8 KiB)        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
配置yum源

查看EulerOS版本。

<gaoy:~>cat /etc/euleros-release EulerOS release 2.0 (SP5)

按照如下情形来配置/etc/yum.repos.d/EulerOS.repo文件

yum repolistyum install lsof -y
安装编译环境Gcc,g++
yum install gcc -y
<gaoy:~/code>cat gcc.test.c #include <stdio.h>void main(){	printf("Hello gcc. ");}<gaoy:~/code>gcc gcc.test.c -o gcc.test<gaoy:~/code>./gcc.test Hello gcc. <gaoy:~/code>
yum install gcc-c++ -y<gaoy:~/code>cat gcc.test.cpp #include <iostream>#include <string>int main(){	std::cout<<"Hello gcc. "<< std::endl;	return 0;}<gaoy:~/code>g++ gcc.test.cpp <gaoy:~/code>./a.out Hello gcc. 
安装Java编译环境
#yum install java-1.8.0-openjdk* -y#cat Hello.java public class Hello{  public static void main(String argv[]){	System.out.println("Hello world java.");  }}#javac Hello.java#java Hello

标签: #ubuntu iostream